GO 交叉编译
阅读 520

Windows

$ GOOS=windows GOARCH=386 go build -ldflags "-s -w" main.go
$ GOOS=windows GOARCH=amd64 go build -ldflags "-s -w" main.go


Linux

$ GOOS=linux GOARCH=386 go build -ldflags "-s -w" main.go
$ GOOS=linux GOARCH=amd64 go build -ldflags "-s -w" main.go


macOS

$ GOOS=darwin GOARCH=amd64 go build -ldflags "-s -w" main.go
[编辑于 2019/04/20 00:10]