aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/internal/modfetch/coderepo_test.go
diff options
context:
space:
mode:
authorBrad Fitzpatrick <bradfitz@golang.org>2018-09-26 21:10:21 +0000
committerBrad Fitzpatrick <bradfitz@golang.org>2018-09-26 22:14:25 +0000
commitda0d1a44bac379f5acedb1933f85400de08f4ac6 (patch)
tree20ac5d1ee7aeed87d3fa33f7e401309d62207f30 /src/cmd/go/internal/modfetch/coderepo_test.go
parente35a41261b19589f40d32bd66274c23ab4b9b32e (diff)
downloadgo-da0d1a44bac379f5acedb1933f85400de08f4ac6.tar.gz
go-da0d1a44bac379f5acedb1933f85400de08f4ac6.zip
all: use strings.ReplaceAll and bytes.ReplaceAll where applicable
I omitted vendor directories and anything necessary for bootstrapping. (Tested by bootstrapping with Go 1.4) Updates #27864 Change-Id: I7d9b68d0372d3a34dee22966cca323513ece7e8a Reviewed-on: https://go-review.googlesource.com/137856 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/cmd/go/internal/modfetch/coderepo_test.go')
-rw-r--r--src/cmd/go/internal/modfetch/coderepo_test.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/cmd/go/internal/modfetch/coderepo_test.go b/src/cmd/go/internal/modfetch/coderepo_test.go
index 79b82786cb..0b62b9ee76 100644
--- a/src/cmd/go/internal/modfetch/coderepo_test.go
+++ b/src/cmd/go/internal/modfetch/coderepo_test.go
@@ -423,7 +423,7 @@ func TestCodeRepo(t *testing.T) {
}
}
}
- t.Run(strings.Replace(tt.path, "/", "_", -1)+"/"+tt.rev, f)
+ t.Run(strings.ReplaceAll(tt.path, "/", "_")+"/"+tt.rev, f)
if strings.HasPrefix(tt.path, vgotest1git) {
for _, alt := range altVgotests {
// Note: Communicating with f through tt; should be cleaned up.
@@ -442,7 +442,7 @@ func TestCodeRepo(t *testing.T) {
tt.rev = remap(tt.rev, m)
tt.gomoderr = remap(tt.gomoderr, m)
tt.ziperr = remap(tt.ziperr, m)
- t.Run(strings.Replace(tt.path, "/", "_", -1)+"/"+tt.rev, f)
+ t.Run(strings.ReplaceAll(tt.path, "/", "_")+"/"+tt.rev, f)
tt = old
}
}
@@ -473,9 +473,9 @@ func remap(name string, m map[string]string) string {
}
}
for k, v := range m {
- name = strings.Replace(name, k, v, -1)
+ name = strings.ReplaceAll(name, k, v)
if codehost.AllHex(k) {
- name = strings.Replace(name, k[:12], v[:12], -1)
+ name = strings.ReplaceAll(name, k[:12], v[:12])
}
}
return name
@@ -522,7 +522,7 @@ func TestCodeRepoVersions(t *testing.T) {
}
defer os.RemoveAll(tmpdir)
for _, tt := range codeRepoVersionsTests {
- t.Run(strings.Replace(tt.path, "/", "_", -1), func(t *testing.T) {
+ t.Run(strings.ReplaceAll(tt.path, "/", "_"), func(t *testing.T) {
repo, err := Lookup(tt.path)
if err != nil {
t.Fatalf("Lookup(%q): %v", tt.path, err)
@@ -570,7 +570,7 @@ func TestLatest(t *testing.T) {
}
defer os.RemoveAll(tmpdir)
for _, tt := range latestTests {
- name := strings.Replace(tt.path, "/", "_", -1)
+ name := strings.ReplaceAll(tt.path, "/", "_")
t.Run(name, func(t *testing.T) {
repo, err := Lookup(tt.path)
if err != nil {