Hi everyone,

recently, I replaced a script which we used for code generation by a small 
go program with the same functionality. The reason for this change was that 
windows failed running the script because it can't interprete the script's 
shebang and tried to treat it like a compiled executable. The change solved 
that problem nicely. However, this seems to have broken cross compilation. 
When setting GOOS=linux on a windows computer, that argument seems to get 
passed to go generate and from there to go run. go run the compiles the 
program for linux (on the windows computer) and tries to run it, which 
fails for obvious reasons.

This doesn't sound like an extremely unusual situation, so I was puzzled 
that I couldn't find any information online on how to best handle this 
specific situation. If you have any hints, I'd be glad to take them. 
Resetting the environment in a script is no solution, as the point of the 
whole change is not to use a script. go generate doesn't provide any way to 
set environment variables.

Best regards,
 Florian

-- 
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