From a44cc76dc11c26d2f2d8d04f05fe0094facfdce0 Mon Sep 17 00:00:00 2001 From: Tormod Erevik Lea Date: Fri, 17 Jun 2022 10:55:46 +0200 Subject: [PATCH] cmd/stringer: use explicit NeedX values instead of deprecated LoadSyntax MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ie25f67fd98d34b0a907bd13357e2643b1b79443b Reviewed-on: https://go-review.googlesource.com/c/tools/+/412914 Reviewed-by: Alex Rakoczy Auto-Submit: Daniel Martí gopls-CI: kokoro Reviewed-by: Ian Lance Taylor Reviewed-by: Daniel Martí Run-TryBot: Daniel Martí TryBot-Result: Gopher Robot Run-TryBot: Ian Lance Taylor Auto-Submit: Ian Lance Taylor --- cmd/stringer/stringer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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,