This commit is contained in:
Lunny Xiao 2019-09-26 01:21:09 +08:00
parent 93fc4604d0
commit 350fbb4ca2
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A
1 changed files with 2 additions and 2 deletions

View File

@ -49,7 +49,7 @@ func quoteNeeded(a interface{}) bool {
return true
}
func covertArg(arg interface{}) string {
func convertArg(arg interface{}) string {
if quoteNeeded(arg) {
argv := fmt.Sprintf("%v", arg)
return "'" + strings.Replace(argv, "'", "''", -1) + "'"
@ -93,7 +93,7 @@ func (statement *Statement) writeArg(w *builder.BytesWriter, arg interface{}) er
return err
}
default:
if _, err := w.WriteString(covertArg(arg)); err != nil {
if _, err := w.WriteString(convertArg(arg)); err != nil {
return err
}
}