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 {
|
for _, obj := range objs {
|
||||||
if obj, _, _ := types.LookupFieldOrMethod(obj.Type(), true, obj.Pkg(), mmbr); obj != nil {
|
if obj, _, _ := types.LookupFieldOrMethod(obj.Type(), true, obj.Pkg(), mmbr); obj != nil {
|
||||||
found = true
|
found = true
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !found {
|
if !found {
|
||||||
|
|
Loading…
Reference in New Issue