When building an application for distribution (even if only to other teams within an organization) it's sometimes handy to bake in some context from the build process (most often things like the Git commit hash, branch, etc.).
In the case of Go this can be achieved by using the CLI
-X parameter. This allows for setting the value of an uninitialized (or initialized to a static string) variable when building an application, e.g.
-ldflags package_name.var_name=value will set the variable
var_name in package
Go code using "version"