Go 编译跨平台

    适用于 [Linux] ,拷贝代码后新建文件 cross.bash,并在 ${go 安装路径}/src 目录下执行。

    #!/usr/bin/env bash
    
    export CGO_ENABLED=0
    
    export GOOS=darwin
    export GOARCH=386
    ./make.bash
    
    export GOOS=linux
    export GOARCH=386
    ./make.bash
    
    export GOOS=windows
    export GOARCH=386
    ./make.bash
    
    
    export GOOS=darwin
    export GOARCH=amd64
    ./make.bash
    
    export GOOS=linux
    export GOARCH=amd64
    ./make.bash
    
    export GOOS=windows
    export GOARCH=amd64
    ./make.bash
    

    ---- EOF ----


    validate