Skip to content

Commit da0d1a4

Browse files
committed
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 <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent e35a412 commit da0d1a4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+104
-104
lines changed

src/cmd/fix/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func usage() {
5252
fmt.Fprintf(os.Stderr, "\n%s\n", f.name)
5353
}
5454
desc := strings.TrimSpace(f.desc)
55-
desc = strings.Replace(desc, "\n", "\n\t", -1)
55+
desc = strings.ReplaceAll(desc, "\n", "\n\t")
5656
fmt.Fprintf(os.Stderr, "\t%s\n", desc)
5757
}
5858
os.Exit(2)

src/cmd/fix/typecheck.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -193,12 +193,12 @@ func typecheck(cfg *TypeConfig, f *ast.File) (typeof map[interface{}]string, ass
193193
var params, results []string
194194
for _, p := range fn.Type.Params.List {
195195
t := gofmt(p.Type)
196-
t = strings.Replace(t, "_Ctype_", "C.", -1)
196+
t = strings.ReplaceAll(t, "_Ctype_", "C.")
197197
params = append(params, t)
198198
}
199199
for _, r := range fn.Type.Results.List {
200200
t := gofmt(r.Type)
201-
t = strings.Replace(t, "_Ctype_", "C.", -1)
201+
t = strings.ReplaceAll(t, "_Ctype_", "C.")
202202
results = append(results, t)
203203
}
204204
cfg.External["C."+fn.Name.Name[7:]] = joinFunc(params, results)

src/cmd/go/go_test.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -1090,7 +1090,7 @@ func testMove(t *testing.T, vcs, url, base, config string) {
10901090
path := tg.path(filepath.Join("src", config))
10911091
data, err := ioutil.ReadFile(path)
10921092
tg.must(err)
1093-
data = bytes.Replace(data, []byte(base), []byte(base+"XXX"), -1)
1093+
data = bytes.ReplaceAll(data, []byte(base), []byte(base+"XXX"))
10941094
tg.must(ioutil.WriteFile(path, data, 0644))
10951095
}
10961096
if vcs == "git" {
@@ -2360,14 +2360,14 @@ func TestShadowingLogic(t *testing.T) {
23602360

23612361
// The math in root1 is not "math" because the standard math is.
23622362
tg.run("list", "-f", "({{.ImportPath}}) ({{.ConflictDir}})", "./testdata/shadow/root1/src/math")
2363-
pwdForwardSlash := strings.Replace(pwd, string(os.PathSeparator), "/", -1)
2363+
pwdForwardSlash := strings.ReplaceAll(pwd, string(os.PathSeparator), "/")
23642364
if !strings.HasPrefix(pwdForwardSlash, "/") {
23652365
pwdForwardSlash = "/" + pwdForwardSlash
23662366
}
23672367
// The output will have makeImportValid applies, but we only
23682368
// bother to deal with characters we might reasonably see.
23692369
for _, r := range " :" {
2370-
pwdForwardSlash = strings.Replace(pwdForwardSlash, string(r), "_", -1)
2370+
pwdForwardSlash = strings.ReplaceAll(pwdForwardSlash, string(r), "_")
23712371
}
23722372
want := "(_" + pwdForwardSlash + "/testdata/shadow/root1/src/math) (" + filepath.Join(runtime.GOROOT(), "src", "math") + ")"
23732373
if strings.TrimSpace(tg.getStdout()) != want {
@@ -2557,7 +2557,7 @@ func TestCoverageErrorLine(t *testing.T) {
25572557

25582558
// It's OK that stderr2 drops the character position in the error,
25592559
// because of the //line directive (see golang.org/issue/22662).
2560-
stderr = strings.Replace(stderr, "p.go:4:2:", "p.go:4:", -1)
2560+
stderr = strings.ReplaceAll(stderr, "p.go:4:2:", "p.go:4:")
25612561
if stderr != stderr2 {
25622562
t.Logf("test -cover changed error messages:\nbefore:\n%s\n\nafter:\n%s", stderr, stderr2)
25632563
t.Skip("golang.org/issue/22660")
@@ -6171,7 +6171,7 @@ func TestCDAndGOPATHAreDifferent(t *testing.T) {
61716171

61726172
testCDAndGOPATHAreDifferent(tg, cd, gopath)
61736173
if runtime.GOOS == "windows" {
6174-
testCDAndGOPATHAreDifferent(tg, cd, strings.Replace(gopath, `\`, `/`, -1))
6174+
testCDAndGOPATHAreDifferent(tg, cd, strings.ReplaceAll(gopath, `\`, `/`))
61756175
testCDAndGOPATHAreDifferent(tg, cd, strings.ToUpper(gopath))
61766176
testCDAndGOPATHAreDifferent(tg, cd, strings.ToLower(gopath))
61776177
}

src/cmd/go/internal/envcmd/env.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ func runEnv(cmd *base.Command, args []string) {
203203
fmt.Printf("%s=\"%s\"\n", e.Name, e.Value)
204204
case "plan9":
205205
if strings.IndexByte(e.Value, '\x00') < 0 {
206-
fmt.Printf("%s='%s'\n", e.Name, strings.Replace(e.Value, "'", "''", -1))
206+
fmt.Printf("%s='%s'\n", e.Name, strings.ReplaceAll(e.Value, "'", "''"))
207207
} else {
208208
v := strings.Split(e.Value, "\x00")
209209
fmt.Printf("%s=(", e.Name)

src/cmd/go/internal/get/vcs.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -964,7 +964,7 @@ func matchGoImport(imports []metaImport, importPath string) (metaImport, error)
964964
// expand rewrites s to replace {k} with match[k] for each key k in match.
965965
func expand(match map[string]string, s string) string {
966966
for k, v := range match {
967-
s = strings.Replace(s, "{"+k+"}", v, -1)
967+
s = strings.ReplaceAll(s, "{"+k+"}", v)
968968
}
969969
return s
970970
}

src/cmd/go/internal/modconv/convert_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ func TestConvertLegacyConfig(t *testing.T) {
146146
}
147147

148148
for _, tt := range tests {
149-
t.Run(strings.Replace(tt.path, "/", "_", -1)+"_"+tt.vers, func(t *testing.T) {
149+
t.Run(strings.ReplaceAll(tt.path, "/", "_")+"_"+tt.vers, func(t *testing.T) {
150150
f, err := modfile.Parse("golden", []byte(tt.gomod), nil)
151151
if err != nil {
152152
t.Fatal(err)

src/cmd/go/internal/modfetch/codehost/codehost.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ func (e *RunError) Error() string {
185185
text := e.Cmd + ": " + e.Err.Error()
186186
stderr := bytes.TrimRight(e.Stderr, "\n")
187187
if len(stderr) > 0 {
188-
text += ":\n\t" + strings.Replace(string(stderr), "\n", "\n\t", -1)
188+
text += ":\n\t" + strings.ReplaceAll(string(stderr), "\n", "\n\t")
189189
}
190190
return text
191191
}

src/cmd/go/internal/modfetch/coderepo_test.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ func TestCodeRepo(t *testing.T) {
423423
}
424424
}
425425
}
426-
t.Run(strings.Replace(tt.path, "/", "_", -1)+"/"+tt.rev, f)
426+
t.Run(strings.ReplaceAll(tt.path, "/", "_")+"/"+tt.rev, f)
427427
if strings.HasPrefix(tt.path, vgotest1git) {
428428
for _, alt := range altVgotests {
429429
// Note: Communicating with f through tt; should be cleaned up.
@@ -442,7 +442,7 @@ func TestCodeRepo(t *testing.T) {
442442
tt.rev = remap(tt.rev, m)
443443
tt.gomoderr = remap(tt.gomoderr, m)
444444
tt.ziperr = remap(tt.ziperr, m)
445-
t.Run(strings.Replace(tt.path, "/", "_", -1)+"/"+tt.rev, f)
445+
t.Run(strings.ReplaceAll(tt.path, "/", "_")+"/"+tt.rev, f)
446446
tt = old
447447
}
448448
}
@@ -473,9 +473,9 @@ func remap(name string, m map[string]string) string {
473473
}
474474
}
475475
for k, v := range m {
476-
name = strings.Replace(name, k, v, -1)
476+
name = strings.ReplaceAll(name, k, v)
477477
if codehost.AllHex(k) {
478-
name = strings.Replace(name, k[:12], v[:12], -1)
478+
name = strings.ReplaceAll(name, k[:12], v[:12])
479479
}
480480
}
481481
return name
@@ -522,7 +522,7 @@ func TestCodeRepoVersions(t *testing.T) {
522522
}
523523
defer os.RemoveAll(tmpdir)
524524
for _, tt := range codeRepoVersionsTests {
525-
t.Run(strings.Replace(tt.path, "/", "_", -1), func(t *testing.T) {
525+
t.Run(strings.ReplaceAll(tt.path, "/", "_"), func(t *testing.T) {
526526
repo, err := Lookup(tt.path)
527527
if err != nil {
528528
t.Fatalf("Lookup(%q): %v", tt.path, err)
@@ -570,7 +570,7 @@ func TestLatest(t *testing.T) {
570570
}
571571
defer os.RemoveAll(tmpdir)
572572
for _, tt := range latestTests {
573-
name := strings.Replace(tt.path, "/", "_", -1)
573+
name := strings.ReplaceAll(tt.path, "/", "_")
574574
t.Run(name, func(t *testing.T) {
575575
repo, err := Lookup(tt.path)
576576
if err != nil {

src/cmd/go/internal/modfetch/proxy.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -248,5 +248,5 @@ func (p *proxyRepo) Zip(version string, tmpdir string) (tmpfile string, err erro
248248
// That is, it escapes things like ? and # (which really shouldn't appear anyway).
249249
// It does not escape / to %2F: our REST API is designed so that / can be left as is.
250250
func pathEscape(s string) string {
251-
return strings.Replace(url.PathEscape(s), "%2F", "/", -1)
251+
return strings.ReplaceAll(url.PathEscape(s), "%2F", "/")
252252
}

src/cmd/go/internal/modload/import_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func TestImport(t *testing.T) {
4545
testenv.MustHaveExternalNetwork(t)
4646

4747
for _, tt := range importTests {
48-
t.Run(strings.Replace(tt.path, "/", "_", -1), func(t *testing.T) {
48+
t.Run(strings.ReplaceAll(tt.path, "/", "_"), func(t *testing.T) {
4949
// Note that there is no build list, so Import should always fail.
5050
m, dir, err := Import(tt.path)
5151
if err == nil {

src/cmd/go/internal/modload/query_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ func TestQuery(t *testing.T) {
132132
ok, _ := path.Match(allow, m.Version)
133133
return ok
134134
}
135-
t.Run(strings.Replace(tt.path, "/", "_", -1)+"/"+tt.query+"/"+allow, func(t *testing.T) {
135+
t.Run(strings.ReplaceAll(tt.path, "/", "_")+"/"+tt.query+"/"+allow, func(t *testing.T) {
136136
info, err := Query(tt.path, tt.query, allowed)
137137
if tt.err != "" {
138138
if err != nil && err.Error() == tt.err {

src/cmd/go/internal/search/search.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ func MatchPattern(pattern string) func(name string) bool {
275275
case strings.HasSuffix(re, `/\.\.\.`):
276276
re = strings.TrimSuffix(re, `/\.\.\.`) + `(/\.\.\.)?`
277277
}
278-
re = strings.Replace(re, `\.\.\.`, `[^`+vendorChar+`]*`, -1)
278+
re = strings.ReplaceAll(re, `\.\.\.`, `[^`+vendorChar+`]*`)
279279

280280
reg := regexp.MustCompile(`^` + re + `$`)
281281

@@ -353,7 +353,7 @@ func CleanPatterns(patterns []string) []string {
353353
// as a courtesy to Windows developers, rewrite \ to /
354354
// in command-line arguments. Handles .\... and so on.
355355
if filepath.Separator == '\\' {
356-
a = strings.Replace(a, `\`, `/`, -1)
356+
a = strings.ReplaceAll(a, `\`, `/`)
357357
}
358358

359359
// Put argument in canonical form, but preserve leading ./.

src/cmd/go/internal/work/build.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -398,10 +398,10 @@ func libname(args []string, pkgs []*load.Package) (string, error) {
398398
arg = bp.ImportPath
399399
}
400400
}
401-
appendName(strings.Replace(arg, "/", "-", -1))
401+
appendName(strings.ReplaceAll(arg, "/", "-"))
402402
} else {
403403
for _, pkg := range pkgs {
404-
appendName(strings.Replace(pkg.ImportPath, "/", "-", -1))
404+
appendName(strings.ReplaceAll(pkg.ImportPath, "/", "-"))
405405
}
406406
}
407407
} else if haveNonMeta { // have both meta package and a non-meta one

src/cmd/go/internal/work/exec.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -1705,14 +1705,14 @@ func (b *Builder) fmtcmd(dir string, format string, args ...interface{}) string
17051705
if dir[len(dir)-1] == filepath.Separator {
17061706
dot += string(filepath.Separator)
17071707
}
1708-
cmd = strings.Replace(" "+cmd, " "+dir, dot, -1)[1:]
1708+
cmd = strings.ReplaceAll(" "+cmd, " "+dir, dot)[1:]
17091709
if b.scriptDir != dir {
17101710
b.scriptDir = dir
17111711
cmd = "cd " + dir + "\n" + cmd
17121712
}
17131713
}
17141714
if b.WorkDir != "" {
1715-
cmd = strings.Replace(cmd, b.WorkDir, "$WORK", -1)
1715+
cmd = strings.ReplaceAll(cmd, b.WorkDir, "$WORK")
17161716
}
17171717
return cmd
17181718
}
@@ -1754,10 +1754,10 @@ func (b *Builder) showOutput(a *Action, dir, desc, out string) {
17541754
prefix := "# " + desc
17551755
suffix := "\n" + out
17561756
if reldir := base.ShortPath(dir); reldir != dir {
1757-
suffix = strings.Replace(suffix, " "+dir, " "+reldir, -1)
1758-
suffix = strings.Replace(suffix, "\n"+dir, "\n"+reldir, -1)
1757+
suffix = strings.ReplaceAll(suffix, " "+dir, " "+reldir)
1758+
suffix = strings.ReplaceAll(suffix, "\n"+dir, "\n"+reldir)
17591759
}
1760-
suffix = strings.Replace(suffix, " "+b.WorkDir, " $WORK", -1)
1760+
suffix = strings.ReplaceAll(suffix, " "+b.WorkDir, " $WORK")
17611761

17621762
if a != nil && a.output != nil {
17631763
a.output = append(a.output, prefix...)

src/cmd/go/proxy_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func readModList() {
7878
if i < 0 {
7979
continue
8080
}
81-
encPath := strings.Replace(name[:i], "_", "/", -1)
81+
encPath := strings.ReplaceAll(name[:i], "_", "/")
8282
path, err := module.DecodePath(encPath)
8383
if err != nil {
8484
fmt.Fprintf(os.Stderr, "go proxy_test: %v\n", err)
@@ -256,7 +256,7 @@ func readArchive(path, vers string) *txtar.Archive {
256256
return nil
257257
}
258258

259-
prefix := strings.Replace(enc, "/", "_", -1)
259+
prefix := strings.ReplaceAll(enc, "/", "_")
260260
name := filepath.Join(cmdGoDir, "testdata/mod", prefix+"_"+encVers+".txt")
261261
a := archiveCache.Do(name, func() interface{} {
262262
a, err := txtar.ParseFile(name)

src/cmd/go/script_test.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ func (ts *testScript) cmdAddcrlf(neg bool, args []string) {
329329
file = ts.mkabs(file)
330330
data, err := ioutil.ReadFile(file)
331331
ts.check(err)
332-
ts.check(ioutil.WriteFile(file, bytes.Replace(data, []byte("\n"), []byte("\r\n"), -1), 0666))
332+
ts.check(ioutil.WriteFile(file, bytes.ReplaceAll(data, []byte("\n"), []byte("\r\n")), 0666))
333333
}
334334
}
335335

@@ -630,7 +630,7 @@ func scriptMatch(ts *testScript, neg bool, args []string, text, name string) {
630630
}
631631

632632
// Matching against workdir would be misleading.
633-
text = strings.Replace(text, ts.workdir, "$WORK", -1)
633+
text = strings.ReplaceAll(text, ts.workdir, "$WORK")
634634

635635
if neg {
636636
if re.MatchString(text) {
@@ -691,7 +691,7 @@ func (ts *testScript) cmdSymlink(neg bool, args []string) {
691691

692692
// abbrev abbreviates the actual work directory in the string s to the literal string "$WORK".
693693
func (ts *testScript) abbrev(s string) string {
694-
s = strings.Replace(s, ts.workdir, "$WORK", -1)
694+
s = strings.ReplaceAll(s, ts.workdir, "$WORK")
695695
if *testWork {
696696
// Expose actual $WORK value in environment dump on first line of work script,
697697
// so that the user can find out what directory -testwork left behind.
@@ -885,17 +885,17 @@ var diffTests = []struct {
885885
func TestDiff(t *testing.T) {
886886
for _, tt := range diffTests {
887887
// Turn spaces into \n.
888-
text1 := strings.Replace(tt.text1, " ", "\n", -1)
888+
text1 := strings.ReplaceAll(tt.text1, " ", "\n")
889889
if text1 != "" {
890890
text1 += "\n"
891891
}
892-
text2 := strings.Replace(tt.text2, " ", "\n", -1)
892+
text2 := strings.ReplaceAll(tt.text2, " ", "\n")
893893
if text2 != "" {
894894
text2 += "\n"
895895
}
896896
out := diff(text1, text2)
897897
// Cut final \n, cut spaces, turn remaining \n into spaces.
898-
out = strings.Replace(strings.Replace(strings.TrimSuffix(out, "\n"), " ", "", -1), "\n", " ", -1)
898+
out = strings.ReplaceAll(strings.ReplaceAll(strings.TrimSuffix(out, "\n"), " ", ""), "\n", " ")
899899
if out != tt.diff {
900900
t.Errorf("diff(%q, %q) = %q, want %q", text1, text2, out, tt.diff)
901901
}

src/cmd/go/testdata/addmod.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ func main() {
142142
}
143143

144144
data := txtar.Format(a)
145-
target := filepath.Join("mod", strings.Replace(path, "/", "_", -1)+"_"+vers+".txt")
145+
target := filepath.Join("mod", strings.ReplaceAll(path, "/", "_")+"_"+vers+".txt")
146146
if err := ioutil.WriteFile(target, data, 0666); err != nil {
147147
log.Printf("%s: %v", arg, err)
148148
exitCode = 1

src/cmd/go/vendor_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func TestVendorImports(t *testing.T) {
3737
vend/x/vendor/p/p [notfound]
3838
vend/x/vendor/r []
3939
`
40-
want = strings.Replace(want+"\t", "\n\t\t", "\n", -1)
40+
want = strings.ReplaceAll(want+"\t", "\n\t\t", "\n")
4141
want = strings.TrimPrefix(want, "\n")
4242

4343
have := tg.stdout.String()

src/cmd/gofmt/gofmt_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ func TestDiff(t *testing.T) {
200200
}
201201

202202
if runtime.GOOS == "windows" {
203-
b = bytes.Replace(b, []byte{'\r', '\n'}, []byte{'\n'}, -1)
203+
b = bytes.ReplaceAll(b, []byte{'\r', '\n'}, []byte{'\n'})
204204
}
205205

206206
bs := bytes.SplitN(b, []byte{'\n'}, 3)

src/cmd/internal/goobj/read.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ func (r *objReader) readRef() {
293293
// In a symbol name in an object file, "". denotes the
294294
// prefix for the package in which the object file has been found.
295295
// Expand it.
296-
name = strings.Replace(name, `"".`, r.pkgprefix, -1)
296+
name = strings.ReplaceAll(name, `"".`, r.pkgprefix)
297297

298298
// An individual object file only records version 0 (extern) or 1 (static).
299299
// To make static symbols unique across all files being read, we

src/cmd/trace/trace.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func httpTrace(w http.ResponseWriter, r *http.Request) {
3838
http.Error(w, err.Error(), http.StatusInternalServerError)
3939
return
4040
}
41-
html := strings.Replace(templTrace, "{{PARAMS}}", r.Form.Encode(), -1)
41+
html := strings.ReplaceAll(templTrace, "{{PARAMS}}", r.Form.Encode())
4242
w.Write([]byte(html))
4343

4444
}

src/cmd/vet/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ func main() {
273273
// Accept space-separated tags because that matches
274274
// the go command's other subcommands.
275275
// Accept commas because go tool vet traditionally has.
276-
tagList = strings.Fields(strings.Replace(*tags, ",", " ", -1))
276+
tagList = strings.Fields(strings.ReplaceAll(*tags, ",", " "))
277277

278278
initPrintFlags()
279279
initUnusedFlags()

src/cmd/vet/vet_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ func errorCheck(outStr string, wantAuto bool, fullshort ...string) (err error) {
243243
for i := range out {
244244
for j := 0; j < len(fullshort); j += 2 {
245245
full, short := fullshort[j], fullshort[j+1]
246-
out[i] = strings.Replace(out[i], full, short, -1)
246+
out[i] = strings.ReplaceAll(out[i], full, short)
247247
}
248248
}
249249

src/crypto/rsa/pss_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ func TestPSSGolden(t *testing.T) {
103103
switch {
104104
case len(line) == 0:
105105
if len(partialValue) > 0 {
106-
values <- strings.Replace(partialValue, " ", "", -1)
106+
values <- strings.ReplaceAll(partialValue, " ", "")
107107
partialValue = ""
108108
lastWasValue = true
109109
}

src/crypto/x509/root_darwin_arm_gen.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,9 @@ func fetchCertIDs() ([]certID, error) {
154154
values := regexp.MustCompile("(?s)<td>(.*?)</td>").FindAllStringSubmatch(row, -1)
155155
name := values[cols["Certificate name"]][1]
156156
fingerprint := values[cols["Fingerprint (SHA-256)"]][1]
157-
fingerprint = strings.Replace(fingerprint, "<br>", "", -1)
158-
fingerprint = strings.Replace(fingerprint, "\n", "", -1)
159-
fingerprint = strings.Replace(fingerprint, " ", "", -1)
157+
fingerprint = strings.ReplaceAll(fingerprint, "<br>", "")
158+
fingerprint = strings.ReplaceAll(fingerprint, "\n", "")
159+
fingerprint = strings.ReplaceAll(fingerprint, " ", "")
160160
fingerprint = strings.ToLower(fingerprint)
161161

162162
ids = append(ids, certID{

0 commit comments

Comments
 (0)