Hi Harmen I described the problem on https://github.com/golang/go/issues/27920, which > got > closed within three minutes as being "documented", and "works as > expected" (which I assume also means "works as intended"). > Is this really the intented behaviour? It seems unexpected to me. Or > should I > simply stay away from `go mod tidy`? >
I replied to your issue earlier. But could arguably have been slightly more detailed in my response beyond simply linking to https://github.com/golang/go/wiki/Modules#why-does-go-mod-tidy-record-indirect-and-test-dependencies-in-my-gomod As you note, github.com/hashicorp/consul/api is a package. It is a package in the module github.com/hashicorp/consul. Despite there being no go.mod in github.com/hashicorp/consul, the go tool simulates it as a module. Given there are no go.mod files in any subdirectories below github.com/hashicorp/consul, then github.com/hashicorp/consul is the module for all the packages github.com/hashicorp/consul/... Hence go mod tidy (per the link in my response to your issue) is pulling in the transitive dependencies needed for tests in github.com/hashicorp/consul/... The reason you see all of these in your go.mod is that github.com/hashicorp/consul has not yet been converted to a module as yet. Hopefully that gives a bit more colour on what's going on here. Thanks, Paul > -- 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.