Open KunalSin9h opened 6 months ago
Hi @KunalSin9h actually I also tried to add ldflags via cmd
but somehow Air is not setting up these flags, but when executing the same command in terminal they do embed the values in the binary
via
cmd
@piyushdatazip how ?
@KunalSin9h I triggered a make
command that sets-up the ldflags which works if I fire in terminal but doesn't when Air is firing that.
I dont understand why you want Air to build your app. Air is not designed for building using ldflags its for development only.
Air is not designed for building using ldflags its for development only.
@KunalSin9h Is it specially mentioned somewhere?
I mean why does that even matter? Air is supposed to detect changes in my files and refire my cmd
and bin
command.
Why specially I need to build is because my program uses variables injected with ldflags so they're unchangeable and aren't picked-up from environment variables and due to that I do need to build for "development" because that's how our system is designed.
There could be difference in approach here, and something else might be suited better for me, but that's what I want, and if you could redirect to something else that can help achieve this, that would be great.
Out of mind i dont have any resource but i will try to recreate what you are doing. And lets we if this is achievable
I know how to use
ldflags
with goreleaser to populate variables at build time. But doinggo install
how air is setting these variables.@cosmtrek can you help me?