mirror of
https://github.com/golang/go
synced 2024-11-19 01:24:39 -07:00
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 <iant@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
6aabc1ca79
commit
cc8e56e55e
@ -152,6 +152,7 @@ func checkExample(pass *analysis.Pass, fn *ast.FuncDecl) {
|
||||
for _, obj := range objs {
|
||||
if obj, _, _ := types.LookupFieldOrMethod(obj.Type(), true, obj.Pkg(), mmbr); obj != nil {
|
||||
found = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
|
Loading…
Reference in New Issue
Block a user