Installation on Linux
Please use the following steps to build and install Delve on Linux.
There are two ways to install on Linux. First is the standard go get
method:
go get -u github.com/go-delve/delve/cmd/dlv
Alternatively make sure $GOPATH is set (e.g. as ~/.go
) and:
$ git clone https://github.com/go-delve/delve.git $GOPATH/src/github.com/go-delve/delve
$ cd $GOPATH/src/github.com/go-delve/delve
$ make install
選擇第二種,執行make install 的時候發現抱錯:
也就是安裝的時候依賴的 x 包國內下載不了,然後百度解決如下:
使用
export GO111MODULE=on (需要依賴於 go module
功能。可通過 export GO111MODULE=on
開啓 MODULE。)
export GOPROXY=https://goproxy.io (公用的代理服務 https://goproxy.io
,我們只需設置該環境變量即可正常下載被牆的源碼包了)
然後再執行 make install
結果ok: