package_test can't find local package

24 views
Skip to first unread message

Dan Kortschak

unread,
Sep 23, 2019, 9:50:29 PM9/23/19
to golang-nuts
I'm putting together a tiny package at the moment that has not yet been
push to a git remote. When I try to run tests I get the following
failure:

$ GOPROXY=off go test
# yaegiconf
package yaegiconf_test
imports github.com/kortschak/yaegiconf: cannot find module
providing package github.com/kortschak/yaegiconf
FAIL yaegiconf [setup failed]

(It's noisier with the proxy on).

There is a go.mod file in the directory that both the package code and
the test code reside in. Is the go tool trying to go to the (non-
existent) repo because it's "package_test" importing "package"? How do
you work around this; it doesn't seem like a replace is going to work
here. Surely this should just work.

Dan Kortschak

unread,
Sep 23, 2019, 10:10:11 PM9/23/19
to golang-nuts
Resolved.

Module name must be fully qualified.
Reply all
Reply to author
Forward
0 new messages