$ go build .
lib.go:3:8: cannot find package "github.com/jadekler/module-testing-2/v3" in any of:
/usr/local/go/src/github.com/jadekler/module-testing-2/v3 (from $GOROOT)
/Users/deklerk/workspace/go/src/github.com/jadekler/module-testing-2/v3 (from $GOPATH)
However, when I place https://github.com/jadekler/module-testing-2 in /tmp and repeat those steps, everything works. This makes me believe it's looking for v3 in my GOPATH (which it will never find, since it's in a branch). I suspect the subdirectory approach of modules does not have this problem.
changed the title
cmd/go: unable to build with v2 of same submodule in GOPATH environmentNov 24, 2018