From ab27c9d5f18cb080aff37770d1c55f2554c6b307 Mon Sep 17 00:00:00 2001 From: Cory Snider Date: Tue, 19 Dec 2023 12:56:46 -0500 Subject: [PATCH] version: use go list -m It appears that the value of Package is intended to be what is nowadays called the module path, not the path to the version package. This also fixes the issue of the version file being regenerated incorrectly under shell redirection as the go list command no longer attempts to parse .go files under the version package. $ ./version.sh > version.go version.go:1:1: expected 'package', found 'EOF' Signed-off-by: Cory Snider --- version/version.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version/version.sh b/version/version.sh index 75dca784..bef4e74d 100755 --- a/version/version.sh +++ b/version/version.sh @@ -12,7 +12,7 @@ package version // Package is the overall, canonical project import path under which the // package was built. -var Package = "$(go list)" +var Package = "$(go list -m)" // Version indicates which version of the binary is running. This is set to // the latest release tag by hand, always suffixed by "+unknown". During