first commit
This commit is contained in:
15
common/tool/placeholders.go
Normal file
15
common/tool/placeholders.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package tool
|
||||
|
||||
import "strings"
|
||||
|
||||
//替换
|
||||
func InPlaceholders(n int) string {
|
||||
var b strings.Builder
|
||||
for i := 0; i < n-1; i++ {
|
||||
b.WriteString("?,")
|
||||
}
|
||||
if n > 0 {
|
||||
b.WriteString("?")
|
||||
}
|
||||
return b.String()
|
||||
}
|
||||
Reference in New Issue
Block a user