发布于 5年前

GO 交叉编译

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
©2020 edoou.com   京ICP备16001874号-3