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

cobra: version: extend by new possibilities of go 1.18 #26

Open
kamilsk opened this issue Aug 8, 2022 · 1 comment
Open

cobra: version: extend by new possibilities of go 1.18 #26

kamilsk opened this issue Aug 8, 2022 · 1 comment
Assignees

Comments

@kamilsk
Copy link
Member

kamilsk commented Aug 8, 2022

Motivation: provide more information about a build.

See octomation/go-tool/issues/29 as related issue.

@kamilsk kamilsk self-assigned this Aug 8, 2022
@kamilsk kamilsk moved this to Backlog in 🏗 Platform Aug 8, 2022
@kamilsk
Copy link
Member Author

kamilsk commented Sep 13, 2023

Example:

$ go version -m -v /opt/homebrew/bin/goimports
/opt/homebrew/bin/goimports: go1.20.7
        path    golang.org/x/tools/cmd/goimports
        mod     golang.org/x/tools      (devel) 
        dep     golang.org/x/mod        v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc=
        dep     golang.org/x/sys        v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM=
        build   -buildmode=exe
        build   -compiler=gc
        build   -trimpath=true
        build   CGO_ENABLED=0
        build   GOARCH=arm64
        build   GOOS=darwin
        build   vcs=git
        build   vcs.revision=eb8a2d42a3f856024def5683ee94919e27f431b8
        build   vcs.time=2023-08-11T18:58:59Z
        build   vcs.modified=true

So, I have to embed this approach to cli version command, e.g., cli version -v and extend current output

$ maintainer version
maintainer:
  version     : (devel)
  build date  : unknown
  git hash    : unknown, mod sum: 
  go version  : go1.21.1
  go compiler : gc
  platform    : darwin/arm64
  features    : boilerplate=true

Read more https://go.dev/doc/go1.18#go-version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

No branches or pull requests

1 participant