0
建立在Windows 8中,每當我試圖下載一個包go get
和go install
我收到以下錯誤:去拿路徑是GOROOT,不是GOPATH錯誤,即使ENV在Windows
cannot download, C:\Users\MYUSER\go is a GOROOT, not a GOPATH. For more details see: 'go help gopath'
我手動設置環境變量GOPATH,GOROOT和GOTOOLDIR的計算機都與當前用戶無濟於事
用戶去ENV
set GOARCH=amd64
set GOBIN=
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Users\MYUSER\go
set GORACE=
set GOROOT=C:\Go
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0
set CXX=g++
set CGO_ENABLED=1
set PKG_CONFIG=pkg-config
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
管理員提示去env
set GOARCH=amd64
set GOBIN=
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Users\MYUSER\go
set GORACE=
set GOROOT=C:\Go
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0
set CXX=g++
set CGO_ENABLED=1
set PKG_CONFIG=pkg-config
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
這是一個已知的問題去得到或我仍然做錯了我的設置?在此先感謝
在某些時候,由於設置了'GOROOT',可能在'C:\ Users \ MYUSER \ go'中有'GOROOT'文件。另外,除非你打算將它們從默認值改變,否則不要設置'GOROOT'或'GOTOOLDIR'。 – JimB
這是前者。獲取應該通知有關這種情況的更多細節,但無論如何,謝謝! –