aboutsummaryrefslogtreecommitdiff
path: root/_content/ref
diff options
context:
space:
mode:
authorJay Conrod <jayconrod@google.com>2021-05-25 17:17:10 -0400
committerJay Conrod <jayconrod@google.com>2021-06-02 14:30:59 +0000
commit45cb0692d0f6cc8ad07e9e38e4a5149e1cc7cd62 (patch)
tree5ea4fb88dad5c03e33d28511077cb167fa735166 /_content/ref
parent64052e727d3c16a4b177c77c4dd01b877533f549 (diff)
downloadgo-x-website-45cb0692d0f6cc8ad07e9e38e4a5149e1cc7cd62.tar.xz
_content/doc: clarify that a replace directive does not imply require
This came up a couple times in Slack recently. I was confused about this myself before we switched to -mod=readonly. Change-Id: I3bafe347f4f9ecc3599e4b2568701422c95066c3 Reviewed-on: https://go-review.googlesource.com/c/website/+/322669 Trust: Jay Conrod <jayconrod@google.com> Reviewed-by: Bryan C. Mills <bcmills@google.com>
Diffstat (limited to '_content/ref')
-rw-r--r--_content/ref/mod.md6
1 files changed, 6 insertions, 0 deletions
diff --git a/_content/ref/mod.md b/_content/ref/mod.md
index 7c80750b..41f1181b 100644
--- a/_content/ref/mod.md
+++ b/_content/ref/mod.md
@@ -675,6 +675,12 @@ must match the module path it replaces.
and are ignored in other modules. See [Minimal version
selection](#minimal-version-selection) for details.
+Note that a `replace` directive alone does not add a module to the [module
+graph](#glos-module-graph). A [`require` directive](#go-mod-file-require) that
+refers to a replaced module version is also needed, either in the main module's
+`go.mod` file or a dependency's `go.mod` file. A `replace` directive has no
+effect if the module version on the left side is not required.
+
```
ReplaceDirective = "replace" ( ReplaceSpec | "(" newline { ReplaceSpec } ")" newline ) .
ReplaceSpec = ModulePath [ Version ] "=>" FilePath newline