Got it to work as intended under Linux; however, compiling on Windows is a 
no-go.  Perhaps I have to create a script, pass the output to a variable, 
and insert the variable into the build command?  Hopefully not, so if 
anybody has any suggestions... it would be highly appreciated.  Thanks!

On Thursday, January 26, 2017 at 9:58:49 PM UTC-6, Eric Brown wrote:
>
> Using -ldflags -X, is there a way to set the internal value as the output 
> of an executable console file?
>
> I've seen examples like this:
>
> "-X main.githash=`git rev-parse HEAD`" (which would put the result of the git 
> command w/ flags into it)
>
>
> however, I just can't get it to work (if it's even possible).
>
> The file I use is called setVersion.exe and does all the formatting, etc. 
> for me (which includes connecting to a ntp atomic time server for the time 
> stamp, etc.).
>
> What I'm using is (setVersion being included in the PATH environment):
>
> go build -ldflags "-X 'main.versionBuild=setVersion'"
>
> I've tried putting the quotations in different places, etc.  Nothing I try 
> is working.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to