]> Cypherpunks.ru repositories - gostls13.git/blobdiff - src/cmd/go/alldocs.go
[dev.fuzz] all: merge master (65f0d24) into dev.fuzz
[gostls13.git] / src / cmd / go / alldocs.go
index 3ff0ba10686c5f416b1a73bbd12193a6dc131a28..18afaf1706b984a27f46db3e9ca2bf70c2032ee4 100644 (file)
 //             directory, but it is not accessed. When -modfile is specified, an
 //             alternate go.sum file is also used: its path is derived from the
 //             -modfile flag by trimming the ".mod" extension and appending ".sum".
+//   -workfile file
+//     in module aware mode, use the given go.work file as a workspace file.
+//             By default or when -workfile is "auto", the go command searches for a
+//             file named go.work in the current directory and then containing directories
+//             until one is found. If a valid go.work file is found, the modules
+//             specified will collectively be used as the main modules. If -workfile
+//             is "off", or a go.work file is not found in "auto" mode, workspace
+//             mode is disabled.
 //     -overlay file
 //             read a JSON config file that provides an overlay for build operations.
 //             The file is a JSON struct with a single field, named 'Replace', that
 //
 //     download    download modules to local cache
 //     edit        edit go.mod from tools or scripts
+//     editwork    edit go.work from tools or scripts
 //     graph       print module requirement graph
 //     init        initialize new module in current directory
+//     initwork    initialize workspace file
 //     tidy        add missing and remove unused modules
 //     vendor      make vendored copy of dependencies
 //     verify      verify dependencies have expected content
 //
 // Usage:
 //
-//     go mod edit [editing flags] [go.mod]
+//     go mod edit [editing flags] [-fmt|-print|-json] [go.mod]
 //
 // Edit provides a command-line interface for editing go.mod,
 // for use primarily by tools or scripts. It reads only go.mod;
 // See https://golang.org/ref/mod#go-mod-edit for more about 'go mod edit'.
 //
 //
+// Edit go.work from tools or scripts
+//
+// Usage:
+//
+//     go mod editwork [editing flags] [go.work]
+//
+// Editwork provides a command-line interface for editing go.work,
+// for use primarily by tools or scripts. It only reads go.work;
+// it does not look up information about the modules involved.
+// If no file is specified, editwork looks for a go.work file in the current
+// directory and its parent directories
+//
+// The editing flags specify a sequence of editing operations.
+//
+// The -fmt flag reformats the go.work file without making other changes.
+// This reformatting is also implied by any other modifications that use or
+// rewrite the go.mod file. The only time this flag is needed is if no other
+// flags are specified, as in 'go mod editwork -fmt'.
+//
+// The -directory=path and -dropdirectory=path flags
+// add and drop a directory from the go.work files set of module directories.
+//
+// The -replace=old[@v]=new[@v] flag adds a replacement of the given
+// module path and version pair. If the @v in old@v is omitted, a
+// replacement without a version on the left side is added, which applies
+// to all versions of the old module path. If the @v in new@v is omitted,
+// the new path should be a local module root directory, not a module
+// path. Note that -replace overrides any redundant replacements for old[@v],
+// so omitting @v will drop existing replacements for specific versions.
+//
+// The -dropreplace=old[@v] flag drops a replacement of the given
+// module path and version pair. If the @v is omitted, a replacement without
+// a version on the left side is dropped.
+//
+// The -directory, -dropdirectory, -replace, and -dropreplace,
+// editing flags may be repeated, and the changes are applied in the order given.
+//
+// The -go=version flag sets the expected Go language version.
+//
+// The -print flag prints the final go.work in its text format instead of
+// writing it back to go.mod.
+//
+// The -json flag prints the final go.work file in JSON format instead of
+// writing it back to go.mod. The JSON output corresponds to these Go types:
+//
+//     type Module struct {
+//             Path    string
+//             Version string
+//     }
+//
+//     type GoWork struct {
+//             Go        string
+//             Directory []Directory
+//             Replace   []Replace
+//     }
+//
+//     type Directory struct {
+//             Path       string
+//             ModulePath string
+//     }
+//
+//     type Replace struct {
+//             Old Module
+//             New Module
+//     }
+//
+// See the workspaces design proposal at
+// https://go.googlesource.com/proposal/+/master/design/45713-workspace.md for
+// more information.
+//
+//
 // Print module requirement graph
 //
 // Usage:
 // and one of its requirements. Each module is identified as a string of the form
 // path@version, except for the main module, which has no @version suffix.
 //
-// The -go flag causes graph to report the module graph as loaded by by the
+// The -go flag causes graph to report the module graph as loaded by the
 // given Go version, instead of the version indicated by the 'go' directive
 // in the go.mod file.
 //
 //
 // Usage:
 //
-//     go mod init [module]
+//     go mod init [module-path]
 //
 // Init initializes and writes a new go.mod file in the current directory, in
 // effect creating a new module rooted at the current directory. The go.mod file
 // See https://golang.org/ref/mod#go-mod-init for more about 'go mod init'.
 //
 //
+// Initialize workspace file
+//
+// Usage:
+//
+//     go mod initwork [moddirs]
+//
+// go mod initwork initializes and writes a new go.work file in the current
+// directory, in effect creating a new workspace at the current directory.
+//
+// go mod initwork optionally accepts paths to the workspace modules as arguments.
+// If the argument is omitted, an empty workspace with no modules will be created.
+//
+// See the workspaces design proposal at
+// https://go.googlesource.com/proposal/+/master/design/45713-workspace.md for
+// more information.
+//
+//
 // Add missing and remove unused modules
 //
 // Usage:
 // used. That subset is: 'atomic', 'bool', 'buildtags', 'errorsas',
 // 'ifaceassert', 'nilfunc', 'printf', and 'stringintconv'. You can see
 // the documentation for these and other vet tests via "go doc cmd/vet".
-// To disable the running of go vet, use the -vet=off flag.
+// To disable the running of go vet, use the -vet=off flag. To run all
+// checks, use the -vet=all flag.
 //
 // All test output and summary lines are printed to the go command's
 // standard output, even if the test printed them to its own standard
 // The rule for a match in the cache is that the run involves the same
 // test binary and the flags on the command line come entirely from a
 // restricted set of 'cacheable' test flags, defined as -benchtime, -cpu,
-// -list, -parallel, -run, -short, and -v. If a run of go test has any test
-// or non-test flags outside this set, the result is not cached. To
-// disable test caching, use any test flag or argument other than the
-// cacheable flags. The idiomatic way to disable test caching explicitly
-// is to use -count=1. Tests that open files within the package's source
-// root (usually $GOPATH) or that consult environment variables only
-// match future runs in which the files and environment variables are unchanged.
-// A cached test result is treated as executing in no time at all,
-// so a successful package test result will be cached and reused
-// regardless of -timeout setting.
+// -list, -parallel, -run, -short, -timeout, -failfast, and -v.
+// If a run of go test has any test or non-test flags outside this set,
+// the result is not cached. To disable test caching, use any test flag
+// or argument other than the cacheable flags. The idiomatic way to disable
+// test caching explicitly is to use -count=1. Tests that open files within
+// the package's source root (usually $GOPATH) or that consult environment
+// variables only match future runs in which the files and environment
+// variables are unchanged. A cached test result is treated as executing
+// in no time at all,so a successful package test result will be cached and
+// reused regardless of -timeout setting.
 //
 // Run 'go help fuzz' for details around how the go command handles fuzz targets.
 //
 //     GCCGOTOOLDIR
 //             If set, where to find gccgo tools, such as cgo.
 //             The default is based on how gccgo was configured.
+//     GOEXPERIMENT
+//             Comma-separated list of toolchain experiments to enable or disable.
+//             The list of available experiments may change arbitrarily over time.
+//             See src/internal/goexperiment/flags.go for currently valid values.
+//             Warning: This variable is provided for the development and testing
+//             of the Go toolchain itself. Use beyond that purpose is unsupported.
 //     GOROOT_FINAL
 //             The root of the installed Go tree, when it is
 //             installed in a location other than where it is built.
 //         The special syntax Nx means to run the fuzz test N times
 //         (for example, -fuzztime 100x).
 //
+//     -json
+//         Log verbose output and test results in JSON. This presents the
+//         same information as the -v flag in a machine-readable format.
+//
 //     -keepfuzzing
 //         Keep running the fuzz target if a crasher is found.
 //