Skip to content

Commit cc8e56e

Browse files
go/analysis/passes/tests: break out of loop when we find a method
Updates golang/go#30971 Change-Id: I7c9250c46fede553689cdc5007b6f330a006b867 Reviewed-on: https://go-review.googlesource.com/c/tools/+/168804 Run-TryBot: Ian Lance Taylor <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
1 parent 6aabc1c commit cc8e56e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

go/analysis/passes/tests/tests.go

+1
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ func checkExample(pass *analysis.Pass, fn *ast.FuncDecl) {
152152
for _, obj := range objs {
153153
if obj, _, _ := types.LookupFieldOrMethod(obj.Type(), true, obj.Pkg(), mmbr); obj != nil {
154154
found = true
155+
break
155156
}
156157
}
157158
if !found {

0 commit comments

Comments
 (0)