use simpler strings funcs
This commit is contained in:
committed by
Jack Christensen
parent
2a8ae6f269
commit
557018a24e
@@ -92,8 +92,8 @@ type Identifier []string
|
|||||||
func (ident Identifier) Sanitize() string {
|
func (ident Identifier) Sanitize() string {
|
||||||
parts := make([]string, len(ident))
|
parts := make([]string, len(ident))
|
||||||
for i := range ident {
|
for i := range ident {
|
||||||
s := strings.Replace(ident[i], string([]byte{0}), "", -1)
|
s := strings.ReplaceAll(ident[i], string([]byte{0}), "")
|
||||||
parts[i] = `"` + strings.Replace(s, `"`, `""`, -1) + `"`
|
parts[i] = `"` + strings.ReplaceAll(s, `"`, `""`) + `"`
|
||||||
}
|
}
|
||||||
return strings.Join(parts, ".")
|
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 {
|
func quoteIdentifier(s string) string {
|
||||||
return `"` + strings.Replace(s, `"`, `""`, -1) + `"`
|
return `"` + strings.ReplaceAll(s, `"`, `""`) + `"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Conn) Ping(ctx context.Context) error {
|
func (c *Conn) Ping(ctx context.Context) error {
|
||||||
|
|||||||
Reference in New Issue
Block a user