All the examples I've found so far assume you are using a Mac and compile for the other platforms.
Asked
Active
Viewed 323 times
1 Answers
2
As stated you can set the GOOS and GOARCH.
you can check all the distro using the following go command
go tool dist list
How to build the application for MacOS
GOOS=darwin GOARCH=amd64 go build main.go

Bobby
- 21
- 1
- 1
-
5That notation (`GOOS=darwin ...`) is for bash (and some other shells) but not windows (CMD/powershell) which is the focus of this question. [This answer](https://stackoverflow.com/a/50080193/11810946) describes a way of setting variables and running a program in one line on windows. – Brits Sep 28 '21 at 04:42
-