proposal: cmd/go: conditional/optional dependency for go mod #32419
What version of Go are you using (
The text was updated successfully, but these errors were encountered:
In Go modules, the module is the unit of dependency. When you are using a proxy (slated to be enabled by default in Go 1.13), you will download only the
For registry-style APIs, I would recommend placing the service-specific implementations in a separate module from the registry package itself. Then the “conditional” aspect of the module graph is exactly: “which packages are in the package import graph?”.
This issue in its current form does not have enough detail to be a proposal.
If you want to describe a general area for improvement, please add an experience report instead.
Otherwise, please describe the specific changes you would like to see, including the motivation or background, syntax, and concrete examples (ideally drawn from experience reports).
hi @bcmills 1.13 is not out, didn't try it.
just run copy the main.go and run
for the above sample, the go.sum would be
if main module does not need package github.com/BurntSushi/toml, why it's in go.sum ?
and just because some lib use ginkgo to test, my sample should depend on that ?
and if i plan to only use sqlite in this project, why
hope my understanding about go.sum is totally wrong .
as specific changes i'd like to see, you can refer extra part in the issue:
eg. bundler groups feature.
if the package author specify ginkgo or goconvey or else as test group. that means ginkgo、goconvey are test dependencies,
as a user, i import the package, i don't care he use what to test the code if it works for me. so i don't need to depend ginkgo, goconvey, i don't even want they appear in my go.sum file as possible,
for some dependencies, if they are for development or test, then in production you don't need to package them at all ...
if i didn't make things clear, you can refer the urls in extra part .
Updates golang/go#36460 Updates golang/go#27900 Updates golang/go#26955 Updates golang/go#30831 Updates golang/go#32058 Updates golang/go#32380 Updates golang/go#32419 Updates golang/go#33370 Updates golang/go#33669 Updates golang/go#36369 Change-Id: I1d4644e3e8b4e688c2fc5a569312495e5072b7d7 Reviewed-on: https://go-review.googlesource.com/c/proposal/+/220080 Reviewed-by: Russ Cox <email@example.com>