refactor: replace strings.Replace with strings.ReplaceAll (#15392)

strings.ReplaceAll(s, old, new) is a wrapper function for
strings.Replace(s, old, new, -1). But strings.ReplaceAll is more
readable and removes the hardcoded -1.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
Eng Zer Jun
2022-08-04 03:22:48 +08:00
committed by GitHub
parent 475a88e813
commit 6141d61839
36 changed files with 56 additions and 56 deletions

View File

@@ -482,7 +482,7 @@ func containsMultilineStatement(stmt string) bool {
}
stmtWithoutLiterals := stmt
for _, literal := range literals {
stmtWithoutLiterals = strings.Replace(stmt, literal, "", -1)
stmtWithoutLiterals = strings.ReplaceAll(stmt, literal, "")
}
// Now look for the word "END" specifically. This will miss any
// representations of END that aren't surrounded by spaces, but