Injecting Variables At Build Time
Full article: https://www.digitalocean.com/community/tutorials/using-ldflags-to-set-version-information-for-go-applications
TLDR:
Given some var in a file"
|
|
The following will overwrite them at build time (also works with go run
)
|
|
If you are unsure of the full name of the variable you and run:
|
|