diff --git a/cmd/stringer/stringer.go b/cmd/stringer/stringer.go index 9f9c85a037..b079985b36 100644 --- a/cmd/stringer/stringer.go +++ b/cmd/stringer/stringer.go @@ -217,7 +217,7 @@ type Package struct { // parsePackage exits if there is an error. func (g *Generator) parsePackage(patterns []string, tags []string) { cfg := &packages.Config{ - Mode: packages.LoadSyntax, + Mode: packages.NeedName | packages.NeedTypes | packages.NeedTypesInfo | packages.NeedSyntax, // TODO: Need to think about constants in test files. Maybe write type_string_test.go // in a separate pass? For later. Tests: false,