Closed pmoieni closed 2 years ago
@pmoieni The next release of the template repo will include https://goreleaser.com/. OS/Arch specific binaries will be published on "release". A cli is also available if local testing is necessary. Hope this covers your requirement.
@haani-niyaz yes. That looks good.
Fixed in v0.2.0
. Closing.
since we don't know which user is using which OS, then executing
go build
ormake build
go will build the binary for that specific OS and Architecture. to avoid that and cross-compile the code we can useGOOS
andGOARCH
environment variables inside theMAKEFILE
.examples
Windows 64-bit:
GOOS=windows GOARCH=amd64 go build -o bin/app-amd64.exe app.go
Windows 32-bit:
GOOS=windows GOARCH=386 go build -o bin/app-386.exe app.go