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:
Oleksandr Redko
2023-02-14 19:36:24 +02:00
committed by GitHub
parent bc5c0d4a9b
commit f6e6eadd22
6 changed files with 11 additions and 11 deletions

View File

@ -293,7 +293,7 @@ func (varCheck *varCheck) checkInScope(line int, scope *proc.EvalScope, t *testi
func (varCheck *varCheck) check(line int, v *proc.Variable, t *testing.T, ctxt string) {
typ := v.DwarfType.String()
typ = strings.Replace(typ, " ", "", -1)
typ = strings.ReplaceAll(typ, " ", "")
if typ != varCheck.typ {
t.Errorf("%d: wrong type for %s (%s), got %s, expected %s", line, v.Name, ctxt, typ, varCheck.typ)
}