mirror of
https://github.com/go-delve/delve.git
synced 2025-10-30 02:07:58 +08:00
pkg/proc,service/test: refactor to strings.ReplaceAll (#3269)
Use strings.ReplaceAll instead of strings.Replace with -1 as the last argument.
This commit is contained in:
@ -4795,7 +4795,7 @@ func TestListPackagesBuildInfo(t *testing.T) {
|
||||
if fidx < 0 {
|
||||
continue
|
||||
}
|
||||
if !strings.HasSuffix(strings.Replace(pkg.DirectoryPath, "\\", "/", -1), pkg.ImportPath[fidx:]) {
|
||||
if !strings.HasSuffix(strings.ReplaceAll(pkg.DirectoryPath, "\\", "/"), pkg.ImportPath[fidx:]) {
|
||||
t.Errorf("unexpected suffix: %q %q", pkg.ImportPath, pkg.DirectoryPath)
|
||||
}
|
||||
}
|
||||
@ -5872,7 +5872,7 @@ func TestNilPtrDerefInBreakInstr(t *testing.T) {
|
||||
|
||||
withTestProcess("asmnilptr/", t, func(p *proc.Target, fixture protest.Fixture) {
|
||||
f := filepath.Join(fixture.BuildDir, asmfile)
|
||||
f = strings.Replace(f, "\\", "/", -1)
|
||||
f = strings.ReplaceAll(f, "\\", "/")
|
||||
setFileBreakpoint(p, t, f, 5)
|
||||
t.Logf("first continue")
|
||||
assertNoError(p.Continue(), t, "Continue()")
|
||||
|
||||
Reference in New Issue
Block a user