mirror of
https://github.com/golang/go
synced 2024-11-13 18:40:22 -07:00
cmd/go: fix 'go help go.mod' example
Dropped the example referred to in the text when copying this text out of 'go help mod fix'. Fixes #27083. Change-Id: I63dfa3033fa2b2408019eef9d8b5a055aa803c57 Reviewed-on: https://go-review.googlesource.com/130140 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
df6aedb630
commit
27ed675b4b
@ -905,13 +905,15 @@
|
|||||||
// corresponding to this Go struct:
|
// corresponding to this Go struct:
|
||||||
//
|
//
|
||||||
// type Module struct {
|
// type Module struct {
|
||||||
// Path string // module path
|
// Path string // module path
|
||||||
// Version string // module version
|
// Version string // module version
|
||||||
// Error string // error loading module
|
// Error string // error loading module
|
||||||
// Info string // absolute path to cached .info file
|
// Info string // absolute path to cached .info file
|
||||||
// GoMod string // absolute path to cached .mod file
|
// GoMod string // absolute path to cached .mod file
|
||||||
// Zip string // absolute path to cached .zip file
|
// Zip string // absolute path to cached .zip file
|
||||||
// Dir string // absolute path to cached source root directory
|
// Dir string // absolute path to cached source root directory
|
||||||
|
// Sum string // checksum for path, version (as in go.sum)
|
||||||
|
// GoModSum string // checksum for go.mod (as in go.sum)
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// See 'go help modules' for more about module queries.
|
// See 'go help modules' for more about module queries.
|
||||||
@ -1617,7 +1619,19 @@
|
|||||||
//
|
//
|
||||||
// The go command automatically updates go.mod each time it uses the
|
// The go command automatically updates go.mod each time it uses the
|
||||||
// module graph, to make sure go.mod always accurately reflects reality
|
// module graph, to make sure go.mod always accurately reflects reality
|
||||||
// and is properly formatted.
|
// and is properly formatted. For example, consider this go.mod file:
|
||||||
|
//
|
||||||
|
// module M
|
||||||
|
//
|
||||||
|
// require (
|
||||||
|
// A v1
|
||||||
|
// B v1.0.0
|
||||||
|
// C v1.0.0
|
||||||
|
// D v1.2.3
|
||||||
|
// E dev
|
||||||
|
// )
|
||||||
|
//
|
||||||
|
// exclude D v1.2.3
|
||||||
//
|
//
|
||||||
// The update rewrites non-canonical version identifiers to semver form,
|
// The update rewrites non-canonical version identifiers to semver form,
|
||||||
// so A's v1 becomes v1.0.0 and E's dev becomes the pseudo-version for the
|
// so A's v1 becomes v1.0.0 and E's dev becomes the pseudo-version for the
|
||||||
|
@ -420,7 +420,19 @@ See 'go help mod edit'.
|
|||||||
|
|
||||||
The go command automatically updates go.mod each time it uses the
|
The go command automatically updates go.mod each time it uses the
|
||||||
module graph, to make sure go.mod always accurately reflects reality
|
module graph, to make sure go.mod always accurately reflects reality
|
||||||
and is properly formatted.
|
and is properly formatted. For example, consider this go.mod file:
|
||||||
|
|
||||||
|
module M
|
||||||
|
|
||||||
|
require (
|
||||||
|
A v1
|
||||||
|
B v1.0.0
|
||||||
|
C v1.0.0
|
||||||
|
D v1.2.3
|
||||||
|
E dev
|
||||||
|
)
|
||||||
|
|
||||||
|
exclude D v1.2.3
|
||||||
|
|
||||||
The update rewrites non-canonical version identifiers to semver form,
|
The update rewrites non-canonical version identifiers to semver form,
|
||||||
so A's v1 becomes v1.0.0 and E's dev becomes the pseudo-version for the
|
so A's v1 becomes v1.0.0 and E's dev becomes the pseudo-version for the
|
||||||
|
Loading…
Reference in New Issue
Block a user