tee -a ~/.zshrc <<EOF
# go
export GOROOT=\$HOME/go
export GOPATH=\$HOME/gopath
export PATH=\$PATH:\$GOROOT/bin:\$GOPATH/bin
EOF
proxy curl -o ~/go.tar.gz -O https://dl.google.com/go/go1.11.2.linux-amd64.tar.gz && \
tar xvf ~/go.tar.gz -C $HOME && \
rm -rf ~/go.tar.gz
# mac
curl -o ~/go.tar.gz -O https://dl.google.com/go/go1.14.1.darwin-amd64.tar.gz && \
tar xvf ~/go.tar.gz -C $HOME && \
rm -rf ~/go.tar.gz
go get -u github.com/ginuerzh/gost/cmd/gost
jupyter for golang
$ go get -u github.com/gopherdata/gophernotes
$ mkdir -p ~/.local/share/jupyter/kernels/gophernotes
$ cp $GOPATH/src/github.com/gopherdata/gophernotes/kernel/* ~/.local/share/jupyter/kernels/gophernotes
- 修改
~/.local/share/jupyter/kernels/gophernotes/kernel.json
文件,注意/root/gopath/bin/gophernotes
为绝对路径
{
"argv": [
"/root/gopath/bin/gophernotes",
"{connection_file}"
],
"display_name": "Go",
"language": "go",
"name": "go"
}