Skip to content

Commit e1cb773

Browse files
Function call can be replaced with helper function (#9)
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
1 parent 00d6bbf commit e1cb773

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

quote.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ func (q Quote) ID(name string) string {
1414
if end > -1 {
1515
name = name[:end]
1616
}
17-
return `"` + strings.Replace(name, `"`, `""`, -1) + `"`
17+
return `"` + strings.ReplaceAll(name, `"`, `""`) + `"`
1818
}
1919

2020
func (q Quote) Value(v interface{}) string {
2121
switch v := v.(type) {
2222
default:
2323
panic("unsupported value")
2424
case string:
25-
v = strings.Replace(v, `'`, `''`, -1)
25+
v = strings.ReplaceAll(v, `'`, `''`)
2626
if strings.Contains(v, `\`) {
27-
v = strings.Replace(v, `\`, `\\`, -1)
27+
v = strings.ReplaceAll(v, `\`, `\\`)
2828
v = ` E'` + v + `'`
2929
} else {
3030
v = `'` + v + `'`

0 commit comments

Comments
 (0)