aboutsummaryrefslogtreecommitdiff
path: root/_content/ref/mod.md
diff options
context:
space:
mode:
authorBryan C. Mills <bcmills@google.com>2021-06-30 11:20:58 -0400
committerBryan C. Mills <bcmills@google.com>2021-06-30 18:47:03 +0000
commit63a720e45b670d431dac51bd46493b00cbd91cfc (patch)
tree75da69735e329dcf6a9c777b901d96ace551ab9a /_content/ref/mod.md
parentf5efdd84789b7f090c7f1a95dfaa572d4ac5e1ab (diff)
downloadgo-x-website-63a720e45b670d431dac51bd46493b00cbd91cfc.tar.xz
_content/ref/mod: clarify that go.mod files are not required for dependencies
We already mentioned this fact elsewhere in the document, but the "go.mod files" section is a likely starting point for someone trying to figure out what happens when the file is missing. This adds some prose and links there to point the reader to the appropriate sections. Noticed via https://stackoverflow.com/q/67030123. Change-Id: Ia7fe50a8b97b8cc1320778c318e5b3b0694d7c05 Reviewed-on: https://go-review.googlesource.com/c/website/+/331949 Trust: Bryan C. Mills <bcmills@google.com> Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
Diffstat (limited to '_content/ref/mod.md')
-rw-r--r--_content/ref/mod.md7
1 files changed, 7 insertions, 0 deletions
diff --git a/_content/ref/mod.md b/_content/ref/mod.md
index 2e835974..cc20bc17 100644
--- a/_content/ref/mod.md
+++ b/_content/ref/mod.md
@@ -356,6 +356,13 @@ edit`](#go-mod-edit) can perform low-level edits. The
[`golang.org/x/mod/modfile`](https://pkg.go.dev/golang.org/x/mod/modfile?tab=doc)
package can be used by Go programs to make the same changes programmatically.
+A `go.mod` file is required for the [main module](#glos-main-module), and for
+any [replacement module](#go-mod-file-replace) specified with a local file path.
+However, a module that lacks an explicit `go.mod` file may still be
+[required](#go-mod-file-require) as a dependency, or used as a replacement
+specified with a module path and version; see [Compatibility with non-module
+repositories](#non-module-compat).
+
### Lexical elements {#go-mod-file-lexical}
When a `go.mod` file is parsed, its content is broken into a sequence of tokens.