1
0
mirror of https://github.com/golang/go synced 2024-11-18 23:05:06 -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:
Ian Lance Taylor 2019-03-22 07:49:12 -07:00
parent 6aabc1ca79
commit cc8e56e55e

View File

@ -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 {