I develop across 3 different platforms, Windows, OS X and Ubuntu Linux.
I use Dropbox to synchronize my code between all 3 platforms.
The problem I have is compiled binaries on OS X and Linux get the same name, so binaries in my GOPATH
are always overwriting each other. I don't have this problem with Windows because binaries always compile with a .exe
extension.
Has anyone else experienced this problem, and if so, how did you get around it?
1- set GOBIN
to separate path (just e.g. for OS X
) and use
go install
If the GOBIN environment variable is set, commands are installed to the directory it names instead of DIR/bin. GOBIN must be an absolute path.
2- Also you may rename the output file:
go build [-o output] [-i] [build flags] [packages]
Like this:
go build -o newname
The -o flag, only allowed when compiling a single package, forces build to write the resulting executable or object to the named output file.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments