Skip to content

go 1.11.4 does not seem to look into the vendor directory #29670

Closed
@cnst

Description

@cnst

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

$ go version
go version go1.11.4 linux/amd64

Does this issue reproduce with the latest release?

Running the latest release direct from a golang.org download.

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

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/ubuntu/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/ubuntu/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build981837178=/tmp/go-build -gno-record-gcc-switches"

What did you do?

go build | & head -4

What did you expect to see?

Nothing — expected the build to complete successfully.

What did you see instead?

ubuntu:R {607} go version
go version go1.11.4 linux/amd64
ubuntu:R {608} go build | & head -4
server.go:10:2: cannot find package "example.org/M/B" in any of:
	/usr/local/go/src/example.org/M/B (from $GOROOT)
	/home/ubuntu/go/src/example.org/M/B (from $GOPATH)
R.go:8:2: cannot find package "example.org/M/D" in any of:
ubuntu:R {609} ll vendor/example.org/M/B/
total 28
4 -rw-r--r-- 1 ubuntu ubuntu  156 Jan 10 17:57 .drone.yml
8 -rw-r--r-- 1 ubuntu ubuntu 6207 Jan 10 17:57 Gopkg.lock
4 -rw-r--r-- 1 ubuntu ubuntu  798 Jan 10 17:57 Gopkg.toml
4 -rw-r--r-- 1 ubuntu ubuntu   53 Jan 10 17:57 README.md
8 -rw-r--r-- 1 ubuntu ubuntu 4783 Jan 10 17:57 B.go
ubuntu:R {610} 

Issue

The issue I'm having is that not only is the vendor directory seemingly completely ignored (at least for this specific project, as per the error message), but that the error message seems to indicate that it's not even being looked at. I am not sure of the proper way to debug this, or how to troubleshoot this further. The vendor directory comes straight as part of a pristine git clone of a production package (that contains this vendor directory directly), and nothing in its path is a symlink.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeGoCommandcmd/goNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.WaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions