-
Notifications
You must be signed in to change notification settings - Fork 18k
go/importer: importer.For("source") fails to load packages from testdata paths #24392
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
Comments
Change https://golang.org/cl/83415 mentions this issue: |
Please consider the fix for a 1.10 point release. Between this issue and #23092, I can't use source imports from gomobile before the importer is fixed at least two releases back. Without a 1.10.1 release, that means from 1.12, almost a year from now. |
@eliasnaur Filed #24452 . |
Change https://golang.org/cl/102789 mentions this issue: |
…kage file lookup The old code was a blend of (copied) code that existed before go/build, and incorrect adjustments made when go/build was introduced. This change leaves package path determination entirely to go/build and in the process fixes issues with relative import paths. Fixes #23092 Fixes #24392 Change-Id: I9e900538b365398751bace56964495c5440ac4ae Reviewed-on: https://go-review.googlesource.com/83415 Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org> Reviewed-on: https://go-review.googlesource.com/102789 Run-TryBot: Andrew Bonventre <andybons@golang.org>
What version of Go are you using (
go version
)?go version devel +29fcd57a9f Sun Mar 4 22:53:50 2018 +0000 linux/amd64
Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOBIN=""
GOCACHE="/home/elias/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/elias/dev/go"
GORACE=""
GOROOT="/home/elias/dev/go-tip"
GOTMPDIR=""
GOTOOLDIR="/home/elias/dev/go-tip/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
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"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build722960365=/tmp/go-build -gno-record-gcc-switches"
What did you do?
Ran
in the srcimporter directory from the attached srcimporterbug.zip
What did you expect to see?
No errors.
What did you see instead?
2018/03/14 18:54:52 got "." want "example.com/testdata/testpkg"
Somehow, the srcimporter is confused by the presence of "testdata" in the import path.
The importer.Default() importer works as expected, after running
I think this is related to #23092 since its proposed CL 83415 also fixes this problem.
The text was updated successfully, but these errors were encountered: