-
Notifications
You must be signed in to change notification settings - Fork 5
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
version outputs unknown #181
Comments
Thank you for your first issue! 😊🕹️ |
Installing released versions appears to report correctly:
and:
and building from sources also looks like it works:
So, clearly, we are capable of getting it right SOME of the time... |
The previous comment somewhat buries the lede in that I am able to reproduce the demonstrated behavior on my machine by running the provided steps. |
Yeah, the version is baked into the binary at build by LDFLAGS. Since go install simply compiles the executable file, it's missing the LDFLAGS context, and reports the hardcoded defaults. I wanted to avoid having to bump version file on every release with a hard coded version number. However, I'm sure there are more creative ways to tackle this or I'm missing something. Look promising: |
Best I can do when installing via ~/git/gilt main ≡
(⎈ |N/A:N/A) aws:(default) ❯ go install github.com/retr0h/gilt/v2@latest
go: downloading github.com/retr0h/gilt/v2 v2.2.1
go: downloading github.com/caarlos0/go-version v0.1.1
go: downloading github.com/go-playground/validator/v10 v10.20.0
go: downloading golang.org/x/term v0.19.0
go: downloading golang.org/x/sys v0.19.0
go: downloading golang.org/x/crypto v0.21.0
go: downloading golang.org/x/net v0.23.0
~/git/gilt main ≡
(⎈ |N/A:N/A) aws:(default) ❯ gilt version
{
"gitVersion": "v2.2.1",
"moduleCheksum": "h1:VrD5HwhF8O54TEcIaCKpDGigNjjJ3TVJVUTuldnQw+0=",
"gitCommit": "unknown",
"gitTreeState": "unknown",
"buildDate": "unknown",
"builtBy": "unknown",
"goVersion": "go1.22.2",
"compiler": "gc",
"platform": "darwin/amd64"
} |
I installed gilt:
Version output
Expected something like
The text was updated successfully, but these errors were encountered: