-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go: Cannot find module providing package of custom libraries #28047
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
@gopherbot, please add label modules |
@pprasanthi I'm not 100% sure what the exact issue is here, but a few quick comments. It looks like you might not be including domain names in your import paths? For example, here:
If so, that could be one source of issues. See some related discussion here regarding domain names and dots in import paths and modules in #27503, including this comment from @bcmills:
Also note that relative imports like import "./subdir" do not work with modules. See for example #26645 (comment). Do you think either of those might explain what you are seeing? Sorry if this is not a 100% helpful comment, but just trying to see if a question or two might help advance the conversation here... |
This is working as designed.
The import in In module mode, you must always use fully-qualified import paths. |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.11 darwin/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="/Users/pprasanthi/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/pprasanthi/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/pprasanthi/gomodtry/tests/src/go.mod"
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/43/hr2mln315bgdqfyr9_bcr38r0000gn/T/go-build210705843=/tmp/go-build -gno-record-gcc-switches -fno-common"
What did you do?
If possible, provide a recipe for reproducing the error.
https://github.com./pprasanthi/gomodtry
What did you expect to see?
I want my tests to run without failures.
What did you see instead?
$ go test ./... -v
⁃ # github.com./pprasanthi/gomodtry/hello
⁃ hello/hello_test.go:5:2: unknown import path "lib/helper": cannot find module providing package lib/helper
⁃ github.com./pprasanthi/gomodtry/hello [setup failed]
⁃ ? github.com./pprasanthi/gomodtry/lib/helper [no test files]
The text was updated successfully, but these errors were encountered: