You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If this file mytest.com/foo/bar/foobar.go is on the GOPATH and build.Import("mytest.com/foo","",build.FindOnly) is called the module package information is returned without an error. But...
If this file is in a vendor folder like /mytest/vendor/mytest.com/foo/bar/foobar.go and build.Import("mytest.com/foo","/mytest",build.FindOnly) is called an error is returned which even indicates that the vendor path was searched but the package was not found, like the following
cannot find package "mytest.com/foo" in any of:
/mytest/vendor/mytest.com/foo (vendor tree)
...
However with the same setup as above importing the full package name works - like build.Import("mytest.com/foo/bar","/mytest",build.FindOnly) returns without errors.
What did you expect to see?
The package should be located even if it is an empty folder in the vendor folder. This is the way the GOPATH works, so a vendor folder should behave the same way.
What did you see instead?
An error indicating the package could not be found (even though it was in the vendor folder)
The text was updated successfully, but these errors were encountered:
What version of Go are you using (
go version
)?go 1.8.3, go 1.9
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/notzippy/tmp/deptest/gopath:/home/notzippy/tmp/deptest/project"
GORACE=""
GOROOT="/home/notzippy/.gvm/gos/go1.9"
GOTOOLDIR="/home/notzippy/.gvm/gos/go1.9/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build150164140=/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"
What did you do?
If this file
mytest.com/foo/bar/foobar.go
is on the GOPATH andbuild.Import("mytest.com/foo","",build.FindOnly)
is called the module package information is returned without an error. But...If this file is in a vendor folder like
/mytest/vendor/mytest.com/foo/bar/foobar.go
andbuild.Import("mytest.com/foo","/mytest",build.FindOnly)
is called an error is returned which even indicates that the vendor path was searched but the package was not found, like the followingHowever with the same setup as above importing the full package name works - like
build.Import("mytest.com/foo/bar","/mytest",build.FindOnly)
returns without errors.What did you expect to see?
The package should be located even if it is an empty folder in the vendor folder. This is the way the GOPATH works, so a vendor folder should behave the same way.
What did you see instead?
An error indicating the package could not be found (even though it was in the vendor folder)
The text was updated successfully, but these errors were encountered: