air-verse / air

☁️ Live reload for Go apps
GNU General Public License v3.0
16.53k stars 779 forks source link

`air -v` not showing version when installed with `go install` #432

Closed roeniss closed 9 months ago

roeniss commented 1 year ago

Hi! The air and go versions are not shown on air -v on my computer.

> go install github.com/cosmtrek/air@v1.43.0
go: downloading github.com/cosmtrek/air v1.43.0
> air -v

  __    _   ___  
 / /\  | | | |_) 
/_/--\ |_| |_| \_ , built with Go 

> trash air
> go install github.com/cosmtrek/air@latest
> air -v

  __    _   ___  
 / /\  | | | |_) 
/_/--\ |_| |_| \_ , built with Go 

I'm on:

> sha256sum air
47c333b9cf61cdaa5b9aab19892c9d452204a58f5abdda6364a4aae9c3a3c164  air

I'm wondering this is known issue.

gaols commented 1 year ago

I think there is a bug. The airVersion used to bind ldflags is not exported, so I created a pull request #433.

makiuchi-d commented 1 year ago

The reason is that go install does not call make. It does not matter if the variable is exported or not.

It should use debug.BuildInfo, like this: makiuchi-d/arelo/arelo.go#L137-L141

xiantang commented 9 months ago

image fixed

roeniss commented 8 months ago

nice work!