New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$GOPATH value not being recognized during build #28593

Closed
andrewinfosec opened this Issue Nov 4, 2018 · 3 comments

Comments

Projects
None yet
5 participants
@andrewinfosec
Copy link

andrewinfosec commented Nov 4, 2018

What version of Go are you using (go version)?

$ go version
go version go1.11.2 darwin/amd64

Does this issue reproduce with the latest release?

I believe go version go1.11.2 darwin/amd64 is the latest release.

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/me/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/me/Google Drive/programming/golang/workspace"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.11.2/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.11.2/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/hb/9lrqhggd35qcrfsgfvgc4gcm0000gn/T/go-build297024427=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

$ echo $GOPATH
/Users/me/Google Drive/programming/golang/workspace
$ go run foo.go
foo.go:4:2: cannot find package "github.com/google/gopacket" in any of:
/usr/local/Cellar/go/1.11.2/libexec/src/github.com/google/gopacket (from $GOROOT)
/Users/me/go/src/github.com/google/gopacket (from $GOPATH)

What did you expect to see?

A successful build.

What did you see instead?

$GOPATH is set but is not being recognized. $GOPATH is defaulting to /Users/me/go even though it has a set value.

@bradfitz

This comment has been minimized.

Copy link
Member

bradfitz commented Nov 5, 2018

What does diskutil list say? Does it work if you use a path that's not under Google Drive? Does it work for a path not containing spaces?

@mvdan

This comment has been minimized.

Copy link
Member

mvdan commented Nov 5, 2018

Also, is the GOPATH variable actually exported? It needs to be for Go to see it. You can check via go env GOPATH.

@gopherbot

This comment has been minimized.

Copy link

gopherbot commented Dec 5, 2018

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

@gopherbot gopherbot closed this Dec 5, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment