Skip to content

Commit b4e0053

Browse files
committed
countParams: fix regex
1 parent a76acee commit b4e0053

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ func countParams(queryStmt *sql.Stmt, queryString string) int {
270270

271271
// Query returned an error
272272
// Parse the error to get the expected params count
273-
regex := regexp.MustCompile(`sql: expected (\p{N}) arguments, got 0`)
273+
regex := regexp.MustCompile(`sql: expected (\p{N}+) arguments, got 0`)
274274
regexSubmatches := regex.FindAllStringSubmatch(err.Error(), 1)
275275
if len(regexSubmatches) != 1 || len(regexSubmatches[0]) != 2 {
276276
// This is weird

0 commit comments

Comments
 (0)