yunabe/lgo

Strange behavior with composite GOPATH: can't load package

bLuka opened this issue · 0 comments

bLuka commented

I need to install lgo on the whole system.

Therefore I set $GOPATH to /usr/local/go during installation, and $LGOPATH to /usr/local/lgo.

I set the right permissions for my user in $LGOPATH.

When the user try to execute lgo run with a composite $GOPATH (like $HOME/go:/usr/local/go, currently /home/jovyan/go:/usr/local/go), here's what happen:

>>> import "fmt"
can't load package: package github.com/yunabe/lgo/sess7b2274696d65223a313533363235363333373931303835323634357d/exec1: cannot find package "github.com/yunabe/lgo/sess7b2274696d65223a313533363235363333373931303835323634357d/exec1" in any of:
	/usr/lib/go-1.10/src/github.com/yunabe/lgo/sess7b2274696d65223a313533363235363333373931303835323634357d/exec1 (from $GOROOT)
	/home/jovyan/go/src/github.com/yunabe/lgo/sess7b2274696d65223a313533363235363333373931303835323634357d/exec1 (from $GOPATH)
	/usr/local/go/src/github.com/yunabe/lgo/sess7b2274696d65223a313533363235363333373931303835323634357d/exec1
E0906 17:52:22.197192    2650 main.go:153] Failed to build a shared library of github.com/yunabe/lgo/sess7b2274696d65223a313533363235363333373931303835323634357d/exec1: exit status 1

When I change the $GOPATH to /usr/local/go without colons, everything works again.

It's a bit annoying since my home is a Docker volume and /usr/local/go is what was setup during the docker build.

Would there be a way to keep both paths with lgo?