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 <csnider@mirantis.com>
This commit is contained in:
Cory Snider 2023-12-19 12:56:46 -05:00
parent 576d93fee3
commit ab27c9d5f1

View file

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