首先下载2进制包
wget https://dl.google.com/go/go1.9.3.linux-amd64.tar.gz
编辑~/.bashrc
export GOPATH=/home/git/go
export GOROOT=/usr/local/src/go
export PATH=${PATH}:$GOROOT/bin
解压:
tar zxf go1.9.3.linux-amd64.tar.gz
mv go $GOROOT
go
ok, 从github取得gogs的源代码并编译
go get -d github.com/gogits/gogs
cd $GOPATH/src/github.com/gogits/gogs
go build
搞定