按照官方解釋门坷,root 權(quán)限下
刪除
? ~ rm -rf /usr/local/go
刪除
? ~ rm -rf /etc/paths.d/go
將環(huán)境變量讶坯,有關(guān) go 的刪了即可
? ~ vim ~/.bash_profile
執(zhí)行完番电,再查看一下
? ~ pkgutil --pkgs | grep -i go
顯示
com.google.sketchup8.sketchup.application
com.google.sketchup8.sketchup.support
com.googlecode.go
如此應(yīng)該可以用
? ~ brew install go
安裝最新版本的了吧,但是
抱歉辆琅,不行漱办,提示
Warning: go-1.8.1 already installed
昨天從裝 go 1.8.1 到今天卸載,內(nèi)心無比崩潰
繼續(xù)看一下哪里還有
? ~ which go
/usr/local/bin/go
? ~ go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/xxx/go"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.8.1/libexec"
GOTOOLDIR="/usr/local/Cellar/go/1.8.1/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/12/qpph2f511xq_hbw9hn8nkq4h0000gn/T/go-build576628875=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
? bin cd /usr/local/Cellar
? Cellar ls
ant gettext icu4c kubernetes-cli libpng openssl readline unixodbc
freetype go jpeg libevent libxml2 php71 tmux wget
? Cellar cd go
? go ls
1.8.1
? go cd ..
? Cellar ls
ant gettext icu4c kubernetes-cli libpng openssl readline unixodbc
freetype go jpeg libevent libxml2 php71 tmux wget
? Cellar rm -rf go
? Cellar which go
go not found
? Cellar cd /
? / which go
go not found
? / go
zsh: command not found: go
重新安裝 go
? / brew install go