I did it the same things also for Darwin OS, like for FreeBSD, now can be compiled also for/on Darwin OS.
Great tool and programming language go, we can do binary file for an others platforms (cross compiling).
With:
go tool dist list obtain GOOS/GOARCH value and to compile we use:
example for Darwin:
GOOS=darwin GOARCH=amd64 go build -ldflags "-X main.appVersion=2.5.1.2981"
or for Windows:
GOOS=windows GOARCH=amd64 go build -ldflags "-X main.appVersion=2.5.1.2981"
or for FreeBSD:
GOOS=freebsd GOARCH=amd64 go build -ldflags "-X main.appVersion=2.5.1.2981"
I did it the same things also for Darwin OS, like for FreeBSD, now can be compiled also for/on Darwin OS. Great tool and programming language
go
, we can do binary file for an others platforms (cross compiling). With:go tool dist list
obtain GOOS/GOARCH value and to compile we use: example for Darwin:GOOS=darwin GOARCH=amd64 go build -ldflags "-X main.appVersion=2.5.1.2981"
or for Windows:GOOS=windows GOARCH=amd64 go build -ldflags "-X main.appVersion=2.5.1.2981"
or for FreeBSD:GOOS=freebsd GOARCH=amd64 go build -ldflags "-X main.appVersion=2.5.1.2981"