You are not logged in.
Pages: 1
Hi, I have set GOPATH variable:
[oz@admin25 rediscovery]$ go env GOPATH
/home/oz/goBut when I am trying to use go get I receive an error:
[oz@admin25 rediscovery]$ go get github.com/stretchr/testify
package github.com/stretchr/testify: cannot download, /home/oz/go is a GOROOT, not a GOPATH. For more details see: 'go help gopath'[oz@admin25 rediscovery]$ go version
go version go1.9.1 linux/amd64
[oz@admin25 rediscovery]$ go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/oz/go"
GORACE=""
GOROOT="/usr/lib/go"
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build561636698=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
[oz@admin25 rediscovery]$ env | grep GO
GOPATH=/home/oz/go
[oz@admin25 rediscovery]$ pacman -Si go
Repository : extra
Name : go
Version : 2:1.9.1-1
Description : Core compiler tools for the Go programming language
Architecture : x86_64
URL : http://golang.org/
Licenses : BSD
Groups : None
Provides : go-pie
Depends On : None
Optional Deps : None
Conflicts With : go-pie
Replaces : None
Download Size : 44.99 MiB
Installed Size : 220.79 MiB
Packager : Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
Build Date : Mon 09 Oct 2017 04:48:03 PM +05
Validated By : MD5 Sum SHA-256 Sum SignatureOffline
Except for a few minor differences (oz is not my login name and I have GOCACHE set) I was able to perform the "go get" from github successfully. That error usually indicates that you have something installed under GOPATH which go is interpreting as part of the go installation and you are not allowed to have GOPATH and GOROOT pointing to the same directory. You should check what sub-directories you have under ~/go, probably back them up, and selectively delete them until you can perform the "go get".
Offline
Except for a few minor differences (oz is not my login name and I have GOCACHE set) I was able to perform the "go get" from github successfully. That error usually indicates that you have something installed under GOPATH which go is interpreting as part of the go installation and you are not allowed to have GOPATH and GOROOT pointing to the same directory. You should check what sub-directories you have under ~/go, probably back them up, and selectively delete them until you can perform the "go get".
Thank you very much.
Offline
Pages: 1