Hi all,

I've played around with go modules in a multi module repository, and I'm 
running into oddities. The main confusion is that I have this idea that any 
package (and its subpackages) that has a go.mod file is a distinct, carved 
out module that has no relation to its siblings and parent, even if they 
happen to reside in the same repository and have their own go.mod files. 
That does not seem to be the case, though.

Here is my experiment: Given the following:

$GOPATH/src/github.com/jadekler/module-testing
|____go.mod
|____LICENSE
|____file.go
|____pkg_a
| |____go.mod
| |____file.go
|____pkg_b
| |____go.mod
| |____file.go
|____pkg_c
| |____go.mod
| |____file.go
|____pkg_d
| |____go.mod
| |____file.go


Questions:


   - If pkg_a depends on pkg_b, I expect the go.mod in pkg_a to contain 
"require github.com/jadekler/module-testing/pkg_b". This does not happen when I 
`go mod init && go mod tidy`. Is that WAI? Why?
   - If pkg_c depends on the parent module, I expect the go.mod in pkg_c to 
contain "require github.com/jadekler/module-testing". This does not happen when 
I `go mod init && go mod tidy`. Is that WAI? Why?

-- 
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 golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to