I'm using versioned Go command to manage my vendors, everything is working but when I run go build
it doesn't find my local packages
I have set the module root inside my go.mod
with I still get an error
build foo: cannot find module for path
The project arch is like
foo/
|__src/github.com/username/package1/package1.go
|__src/github.com/username/package2/package2.go
|__src/github.com/username/package3/package3.go
|__main.go
|__go.mod
|__go.sum
So my go.mod
look like
module foo
require (
...
)
I followed https://research.swtch.com/vgo-tour but I don't understand why this is not working.
My Go version is 1.11
and the foo
folder is inside my GOPATH
when I try outside the GOPATH
this is not even working.
The only time I made it work is doing
module github.com/username/package1
require (
...
)
but the 2 other packages are not found and I get the same error as above.
Did I miss something or do the module path I provide must be changed ?