]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: fix references to old `go mod editwork`
authorHana <hyangah@gmail.com>
Tue, 7 Dec 2021 22:50:50 +0000 (17:50 -0500)
committerHyang-Ah Hana Kim <hyangah@gmail.com>
Wed, 8 Dec 2021 01:23:09 +0000 (01:23 +0000)
That is replaced by `go work edit`.

Change-Id: I39996c7bea0182a18edf6a1f70b6616c74099a1b
Reviewed-on: https://go-review.googlesource.com/c/go/+/370139
Reviewed-by: Michael Matloob <matloob@golang.org>
Trust: Hyang-Ah Hana Kim <hyangah@gmail.com>

src/cmd/go/alldocs.go
src/cmd/go/internal/modload/init.go
src/cmd/go/internal/workcmd/edit.go
src/cmd/go/internal/workcmd/init.go
src/cmd/go/testdata/script/work_replace_conflict.txt

index b9fca791be6ed4f1eb97a00b14eb0b978fcc1af2..f9a2b59c05158b5378265f40ee5b96486c193cb0 100644 (file)
 //
 //     go work edit [editing flags] [go.work]
 //
-// Editwork provides a command-line interface for editing go.work,
+// Edit 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
+// If no file is specified, Edit 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'.
+// flags are specified, as in 'go work edit -fmt'.
 //
 // The -use=path and -dropuse=path flags
 // add and drop a use directive from the go.work file's set of module directories.
 //
 //     go work init [moddirs]
 //
-// go mod initwork initializes and writes a new go.work file in the current
+// Init 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.
+// go work init 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
index 943547e71baf341517a5f09d8660dc12e101d199..854c17d7768abce19dba7c616496db884062f50a 100644 (file)
@@ -1019,7 +1019,7 @@ func makeMainModules(ms []module.Version, rootDirs []string, modFiles []*modfile
                                if replacedByWorkFile[r.Old.Path] {
                                        continue
                                } else if prev, ok := replacements[r.Old]; ok && !curModuleReplaces[r.Old] && prev != r.New {
-                                       base.Fatalf("go: conflicting replacements for %v:\n\t%v\n\t%v\nuse \"go mod editwork -replace %v=[override]\" to resolve", r.Old, prev, r.New, r.Old)
+                                       base.Fatalf("go: conflicting replacements for %v:\n\t%v\n\t%v\nuse \"go work edit -replace %v=[override]\" to resolve", r.Old, prev, r.New, r.Old)
                                }
                                curModuleReplaces[r.Old] = true
                                replacements[r.Old] = r.New
index 03a27f2bc60ff39b0569c146e17187414a169877..c42000710e0f5c56d037288f164156d3d7b7e585 100644 (file)
@@ -24,10 +24,10 @@ import (
 var cmdEdit = &base.Command{
        UsageLine: "go work edit [editing flags] [go.work]",
        Short:     "edit go.work from tools or scripts",
-       Long: `Editwork provides a command-line interface for editing go.work,
+       Long: `Edit 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
+If no file is specified, Edit looks for a go.work file in the current
 directory and its parent directories
 
 The editing flags specify a sequence of editing operations.
@@ -35,7 +35,7 @@ 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'.
+flags are specified, as in 'go work edit -fmt'.
 
 The -use=path and -dropuse=path flags
 add and drop a use directive from the go.work file's set of module directories.
@@ -123,7 +123,7 @@ func runEditwork(ctx context.Context, cmd *base.Command, args []string) {
                        len(workedits) > 0
 
        if !anyFlags {
-               base.Fatalf("go: no flags specified (see 'go help mod editwork').")
+               base.Fatalf("go: no flags specified (see 'go help work edit').")
        }
 
        if *editJSON && *editPrint {
@@ -131,7 +131,7 @@ func runEditwork(ctx context.Context, cmd *base.Command, args []string) {
        }
 
        if len(args) > 1 {
-               base.Fatalf("go: 'go mod editwork' accepts at most one argument")
+               base.Fatalf("go: 'go help work edit' accepts at most one argument")
        }
        var gowork string
        if len(args) == 1 {
index fde1483efbc9f4ee9b5895a79338c8a8ef8e11df..2297ac20d0a4ead31a74fb366c0086aae746c86d 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// go mod initwork
+// go work init
 
 package workcmd
 
@@ -20,10 +20,10 @@ import (
 var cmdInit = &base.Command{
        UsageLine: "go work init [moddirs]",
        Short:     "initialize workspace file",
-       Long: `go mod initwork initializes and writes a new go.work file in the current
+       Long: `Init 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.
+go work init 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
index e5677b21d72ede3fcb561075767994f844a05fda..81d1fcb04356b1902974a1cd3cefd42eca89439f 100644 (file)
@@ -2,7 +2,7 @@
 # overriding it in the go.work file.
 
 ! go list -m example.com/dep
-stderr 'go: conflicting replacements for example.com/dep@v1.0.0:\n\t./dep1\n\t./dep2\nuse "go mod editwork -replace example.com/dep@v1.0.0=\[override\]" to resolve'
+stderr 'go: conflicting replacements for example.com/dep@v1.0.0:\n\t./dep1\n\t./dep2\nuse "go work edit -replace example.com/dep@v1.0.0=\[override\]" to resolve'
 go work edit -replace example.com/dep@v1.0.0=./dep1
 go list -m example.com/dep
 stdout 'example.com/dep v1.0.0 => ./dep1'