Skip to content

Strange behavior with composite GOPATH: can't load package #71

@bLuka

Description

@bLuka

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions