Closed thomasf closed 9 years ago
I was using environment variables as it seemed like that was what many people were using to cross compile:
http://stackoverflow.com/questions/12168873/cross-compile-go-on-osx
Maybe the order in which it is set goes:
flag -> env vars -> runtime ?
Let me know your thoughts before we merge in #3
I actually decided to pull go-selfupdate into my application because I only need a smaller subset of features. I'll make that change anyway, I will set the default value for the flag from the environment, but only if both GOOS and GOARCH are set.
I've made that change
If I understand what you want to do this is incorrect:
plat = os.Getenv("GOOS") + "-" + os.Getenv("GOARCH")
runtime.GOOS and runtime.GOARCH should be used instead(?)
My reason for asking is that I am adding more command line options (using flags) and I stumbled upon this inconsistency.
This is the work so far.. It's mostly done and compatible with the the current way arguments are handed:
https://github.com/thomasf/go-selfupdate/compare/sanbornm:master...master