Source file src/cmd/go/internal/modload/help.go

     1  // Copyright 2018 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package modload
     6  
     7  import "cmd/go/internal/base"
     8  
     9  var HelpModules = &base.Command{
    10  	UsageLine: "modules",
    11  	Short:     "modules, module versions, and more",
    12  	Long: `
    13  Modules are how Go manages dependencies.
    14  
    15  A module is a collection of packages that are released, versioned, and
    16  distributed together. Modules may be downloaded directly from version control
    17  repositories or from module proxy servers.
    18  
    19  For a series of tutorials on modules, see
    20  https://golang.org/doc/tutorial/create-module.
    21  
    22  For a detailed reference on modules, see https://golang.org/ref/mod.
    23  
    24  By default, the go command may download modules from https://proxy.golang.org.
    25  It may authenticate modules using the checksum database at
    26  https://sum.golang.org. Both services are operated by the Go team at Google.
    27  The privacy policies for these services are available at
    28  https://proxy.golang.org/privacy and https://sum.golang.org/privacy,
    29  respectively.
    30  
    31  The go command's download behavior may be configured using GOPROXY, GOSUMDB,
    32  GOPRIVATE, and other environment variables. See 'go help environment'
    33  and https://golang.org/ref/mod#private-module-privacy for more information.
    34  	`,
    35  }
    36  
    37  var HelpGoMod = &base.Command{
    38  	UsageLine: "go.mod",
    39  	Short:     "the go.mod file",
    40  	Long: `
    41  A module version is defined by a tree of source files, with a go.mod
    42  file in its root. When the go command is run, it looks in the current
    43  directory and then successive parent directories to find the go.mod
    44  marking the root of the main (current) module.
    45  
    46  The go.mod file format is described in detail at
    47  https://golang.org/ref/mod#go-mod-file.
    48  
    49  To create a new go.mod file, use 'go mod init'. For details see
    50  'go help mod init' or https://golang.org/ref/mod#go-mod-init.
    51  
    52  To add missing module requirements or remove unneeded requirements,
    53  use 'go mod tidy'. For details, see 'go help mod tidy' or
    54  https://golang.org/ref/mod#go-mod-tidy.
    55  
    56  To add, upgrade, downgrade, or remove a specific module requirement, use
    57  'go get'. For details, see 'go help module-get' or
    58  https://golang.org/ref/mod#go-get.
    59  
    60  To make other changes or to parse go.mod as JSON for use by other tools,
    61  use 'go mod edit'. See 'go help mod edit' or
    62  https://golang.org/ref/mod#go-mod-edit.
    63  	`,
    64  }
    65  

View as plain text