1
0
mirror of https://github.com/golang/go synced 2024-11-18 11:04:42 -07:00

go/analysis/internal/checker: don't filter facts of parameters

Change-Id: Iec34ff62159b77eda6732e16b710a5809cf7329b
Reviewed-on: https://go-review.googlesource.com/c/tools/+/236526
Run-TryBot: Dominik Honnef <dominik@honnef.co>
Reviewed-by: Michael Matloob <matloob@golang.org>
This commit is contained in:
Dominik Honnef 2020-06-07 13:58:31 +02:00
parent 5359b67ffb
commit eb789aa7ce

View File

@ -800,8 +800,13 @@ func exportedFrom(obj types.Object, pkg *types.Package) bool {
return obj.Exported() && obj.Pkg() == pkg ||
obj.Type().(*types.Signature).Recv() != nil
case *types.Var:
return obj.Exported() && obj.Pkg() == pkg ||
obj.IsField()
if obj.IsField() {
return true
}
// we can't filter more aggressively than this because we need
// to consider function parameters exported, but have no way
// of telling apart function parameters from local variables.
return obj.Pkg() == pkg
case *types.TypeName, *types.Const:
return true
}