use simpler strings funcs

pull/844/head
Oleg Kovalov 2020-10-05 20:15:03 +02:00 committed by Jack Christensen
parent 2a8ae6f269
commit 557018a24e
1 changed files with 3 additions and 3 deletions

View File

@ -92,8 +92,8 @@ type Identifier []string
func (ident Identifier) Sanitize() string {
parts := make([]string, len(ident))
for i := range ident {
s := strings.Replace(ident[i], string([]byte{0}), "", -1)
parts[i] = `"` + strings.Replace(s, `"`, `""`, -1) + `"`
s := strings.ReplaceAll(ident[i], string([]byte{0}), "")
parts[i] = `"` + strings.ReplaceAll(s, `"`, `""`) + `"`
}
return strings.Join(parts, ".")
}
@ -390,7 +390,7 @@ func (c *Conn) log(ctx context.Context, lvl LogLevel, msg string, data map[strin
}
func quoteIdentifier(s string) string {
return `"` + strings.Replace(s, `"`, `""`, -1) + `"`
return `"` + strings.ReplaceAll(s, `"`, `""`) + `"`
}
func (c *Conn) Ping(ctx context.Context) error {