I am writing a go program to parse csv files and upload them to a postgres database in the Heroku cloud. The program works fine on my mac laptop. Eventual target platform for deploying the code is Windows though. I did some research and found that the following command creates a Windows executable on my Mac.
env GOOS=windows GOARCH=386 go build -v main.go
This produced an executable called main.exe when I had just one file called main.go. The program has grown since then and I have it now split into three source files:
main.go
common.go
specific.go
They are all in the same source directory though. Moreover, since the program is relatively small, I have all functions in the 'main' package. What is the command now to cross-compile on mac for windows for multiple source files belonging to the same package? The previous command did not work since the other two file common.go and specific.go are not included. Also, I would like to know how to rename the Windows 'exe' file to something else than main.exe, e.g., upload.exe? I am using go version go1.5 darwin/amd64