]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: replace a TODO with an explanatory comment
authorBryan C. Mills <bcmills@google.com>
Thu, 17 Jun 2021 18:12:34 +0000 (14:12 -0400)
committerBryan C. Mills <bcmills@google.com>
Thu, 17 Jun 2021 19:52:18 +0000 (19:52 +0000)
I left a TODO to decide whether to add 'go get' arguments as indirect
(as we have in the past), or to make them direct. I considered both
options, and decided to keep the indirect default because it is easier
(and less invasive) for users to fix.

Updates #45979

Change-Id: I1f23a88db59a01bdd9e6fe48c2fffc8a3b55145a
Reviewed-on: https://go-review.googlesource.com/c/go/+/328971
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Michael Matloob <matloob@golang.org>
src/cmd/go/testdata/script/mod_get_lazy_indirect.txt

index 13640cbc235ad4f13e428e42bfd1d44fb981e2b1..1cef9d1c0cf1e21bd8b5875c3940827573618190 100644 (file)
@@ -10,10 +10,12 @@ stderr '^m.go:3:8: no required module provides package rsc\.io/quote; to add it:
 
 
 # When we run the suggested 'go get' command, the new dependency can be used
-# immediately, even though 'go get' marks it as 'indirect'.
+# immediately.
 #
-# TODO(#45979): Should we swap this default state, so that new dependencies
-# are added as direct unless otherwise noted?
+# 'go get' marks the new dependency as 'indirect', because it doesn't scan
+# enough source code to know whether it is direct, and it is easier and less
+# invasive to remove an incorrect indirect mark (e.g. using 'go get') than to
+# add one that is missing ('go mod tidy' or 'go mod vendor').
 
 go get rsc.io/quote
 grep 'rsc.io/quote v\d+\.\d+\.\d+ // indirect$' go.mod