aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/internal/modcmd/mod.go
diff options
context:
space:
mode:
authorBaokun Lee <nototon@gmail.com>2018-07-14 04:17:19 +0800
committerBryan C. Mills <bcmills@google.com>2018-07-13 22:06:20 +0000
commit00f32fbe7ab053f67e255d1350a34e05b07a6ad6 (patch)
tree490fa1efa7c6237566b7c17e962ada12cc1c399e /src/cmd/go/internal/modcmd/mod.go
parent5e60479ba4c351182838d2de2d8a8883d6b42c09 (diff)
downloadgo-00f32fbe7ab053f67e255d1350a34e05b07a6ad6.tar.gz
go-00f32fbe7ab053f67e255d1350a34e05b07a6ad6.zip
cmd/go: fix module replace flag parsed bug
In CL 122404, we change -replace syntax from => to =. And we also need to change this and the tests. Fixes golang/go#26373. Change-Id: I2d4e85e10c1578540cc7673b93d849270940d776 Reviewed-on: https://go-review.googlesource.com/123778 Reviewed-by: Bryan C. Mills <bcmills@google.com> Run-TryBot: Bryan C. Mills <bcmills@google.com>
Diffstat (limited to 'src/cmd/go/internal/modcmd/mod.go')
-rw-r--r--src/cmd/go/internal/modcmd/mod.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/go/internal/modcmd/mod.go b/src/cmd/go/internal/modcmd/mod.go
index d8ae1d95ac..ddf5000dd8 100644
--- a/src/cmd/go/internal/modcmd/mod.go
+++ b/src/cmd/go/internal/modcmd/mod.go
@@ -400,7 +400,7 @@ func flagReplace(arg string) {
if i = strings.Index(arg, "="); i < 0 {
base.Fatalf("go mod: -replace=%s: need old@v=new[@v] (missing =)", arg)
}
- old, new := strings.TrimSpace(arg[:i]), strings.TrimSpace(arg[i+2:])
+ old, new := strings.TrimSpace(arg[:i]), strings.TrimSpace(arg[i+1:])
if strings.HasPrefix(new, ">") {
base.Fatalf("go mod: -replace=%s: separator between old and new is =, not =>", arg)
}