diff --git a/go-runtime/schema/finalize/analyzer.go b/go-runtime/schema/finalize/analyzer.go index 8e6e67d225..d1e7b5dc23 100644 --- a/go-runtime/schema/finalize/analyzer.go +++ b/go-runtime/schema/finalize/analyzer.go @@ -94,28 +94,22 @@ func Run(pass *analysis.Pass) (interface{}, error) { func getCalls(pass *analysis.Pass) (functionCalls map[types.Object]sets.Set[types.Object], verbCalls map[types.Object]sets.Set[*schema.Ref]) { fnCalls := make(map[types.Object]sets.Set[types.Object]) for obj, calls := range common.GetAllFactsOfType[*common.FunctionCall](pass) { - if len(calls) < 1 { - continue - } - fnCall := calls[0] - - if fnCalls[obj] == nil { - fnCalls[obj] = sets.NewSet[types.Object]() + for _, fnCall := range calls { + if fnCalls[obj] == nil { + fnCalls[obj] = sets.NewSet[types.Object]() + } + fnCalls[obj].Add(fnCall.Callee) } - fnCalls[obj].Add(fnCall.Callee) } vCalls := make(map[types.Object]sets.Set[*schema.Ref]) for obj, calls := range common.GetAllFactsOfType[*common.VerbCall](pass) { - if len(calls) < 1 { - continue - } - vCall := calls[0] - - if vCalls[obj] == nil { - vCalls[obj] = sets.NewSet[*schema.Ref]() + for _, vCall := range calls { + if vCalls[obj] == nil { + vCalls[obj] = sets.NewSet[*schema.Ref]() + } + vCalls[obj].Add(vCall.VerbRef) } - vCalls[obj].Add(vCall.VerbRef) } return fnCalls, vCalls }