English / 中文
Notice: pay attention to the user execution permission.
- Firstly, make the directory on the linux host.
mkdir -p /data/gowork/src/github.com/WeBankPartners/- Download and decompress Golang binary package.
cd /data/
wget https://dl.google.com/go/go1.12.9.linux-amd64.tar.gz
tar xzvf go1.12.9.linux-amd64.tar.gz - Set Golang environmental variables. Make file golang.sh under directory
/data/with the following content:
export GOROOT=/data/go
export GOPATH=/data/gowork
export PATH=$PATH:$GOPATH/bin:$GOROOT/bin- Run the command to make it effective.
source /data/golang.sh- You can run go version to make sure successful.
go version- Clone
SaltStackPlugin source code.
cd /data/gowork/src/github.com/WeBankPartners/
git clone https://github.com/WeBankPartners/wecube-plugins-saltstack.git- Build the source code.
cd /data/gowork/src/github.com/WeBankPartners/wecube-plugins-saltstack
go build -
Make directory
D:\gowork\src\github.com\WeBankPartners. -
If your computer haven't installed git client yet, please install Git for Windows.
-
Install Golang for Windows. During installation, please change the installing directory to D:\go.
-
After installation, input the command
go versionto view the Golang version. -
Set environmental variables
GOROOTandGOPATH:
GOROOT=D:\go
GOPATH=D:\gowork- Git clone SaltStack plugin source code. In the cmd, change the directory to D:\gowork\src\github.com\WeBankPartners and run the following command.
git clone https://github.com/WeBankPartners/wecube-plugins-saltstack.git- Build SaltStack plugin source code. Please go into D:\gowork\src\github.com\WeBankPartners\wecube-plugins-saltstack and run go build in the cmd command line.
go build - The first need Golang installed. Use brew to install Golang, as follow.
brew install go-
You can use go env to view the Golang version. The GOROOT displayed at this time is the installation directory where you installed the Golang using brew.
-
Set Golang environmental variables.
vim ~/.bash_profileSet values for GOROOT、GOPATH、GOBIN、PATH
GOROOT=/usr/local/go
export GOROOT
export GOPATH=/Users/gowork/go
export GOBIN=$GOPATH/bin
export PATH=$PATH:$GOBIN:$GOROOT/binMake it effective
source ~/.bash_profile- Please make the directory, as follow.
mkdir -p /Users/gowork/go/src/github.com/WeBankPartners/- Git clone SaltStack Plugin source code.
cd /Users/gowork/go/src/github.com/WeBankPartners/
git clone https://github.com/WeBankPartners/wecube-plugins-saltstack.git- Build SaltStack Plugin source code.
cd /Users/gowork/go/src/github.com/WeBankPartners/wecube-plugins-saltstack/
go build