Compiled for different platforms go executable file

Now with the mac.

Written on mac go put the code that can be compiled into mac file, the file should be compiled into linux.

Two carry out his next script.

 

build-linux.sh

#!/bin/bash

package='k8s-web-terminal-linux'
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ${package} server.go
chmod +x ${package}

 

build-mac.sh 

#!/bin/bash

package='k8s-web-terminal-mac'
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o ${package} server.go
chmod +x ${package}

 

Guess you like

Origin www.cnblogs.com/aguncn/p/12511882.html