go build application inject variable code example Example: golang compile with injected variable go build -ldflags "-X main.InternalVarName=$BASH_VAR_NAME"