I think because GOPATH is not set it is defaulting to $HOME/go (see Go 1.9 release notes, from memory). Try moving your code to another folder.
On Friday, 21 September 2018 05:21:32 UTC+10, John wrote: > > Just started playing with modules recently. Having an issue I don't > understand, wondering if anyone has seen it, the few references to the > error did not provide anything I saw relevant for what I'm doing. > > given a directory structure such as: > > <home>/go/ > src/ > pkg/ > bin/ > > GOPATH NOT SET > GO111MODULE = on > > If the working directory is: > <home>/go/src/ > > go test ./... > > *Results in:* > go: cannot determine module path for source directory /home/jdoak/go/src > (outside GOPATH, no import comments) > > This also occurs if I do: > > go test subdir/subdir/packagedir/... > > But it will work if I do: > > working directory: <home>/go/src/subdir/subdir/packagedir/ > > go test ./... > > I'm sure I'm doing something wrong. If someone could enlighten me. > > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
