Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

goversion v1.2.0 fails to extract moduleinfo on 1.16.13 binary built via go install #22

Open
dnwe opened this issue Jan 15, 2022 · 0 comments

Comments

@dnwe
Copy link

dnwe commented Jan 15, 2022

rsc.io/[email protected] fails to extract the module info in this scenario:

$ KURED_VERSION=1.9.1
$ GOBIN=$PWD
$ go install -ldflags "-X main.version=${KURED_VERSION}" \
    "github.com/weaveworks/kured/cmd/kured@${KURED_VERSION}"
$ goversion -m kured
kured go1.16.13
$

Obviously the built-in go version cmd in 1.16.13 can successfully extract the module info:

$ go version -m kured  | head -5
kured: go1.16.13
        path    github.com/weaveworks/kured/cmd/kured
        mod     github.com/weaveworks/kured     v0.0.0-20220106181305-2b36eab0f829      h1:gkiQx0LbROxAqRgcqLqO8dnKWWmbuHpOwwbOl9Numcc=
        dep     github.com/MakeNowJust/heredoc  v0.0.0-20170808103936-bb23615498cd      h1:sjQovDkwrZp8u+gxLtPgKGjk5hCxuy2hrRejBTA9xFU=
        dep     github.com/PuerkitoBio/purell   v1.1.1  h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI=

And similarly if I use Filo Sottile's version that rewrites atop the internal/version pkg (#17) then that can also read it:

$ goversion -m kured  | head -5
kured go1.16.13
        path  github.com/weaveworks/kured/cmd/kured
        mod   github.com/weaveworks/kured                       v0.0.0-20220106181305-2b36eab0f829
        dep   github.com/MakeNowJust/heredoc                    v0.0.0-20170808103936-bb23615498cd
        dep   github.com/PuerkitoBio/purell                     v1.1.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant