Skip to content

Commit 5a0cd2e

Browse files
committed
Add tests for squirrel.Eq
1 parent 8cbab0c commit 5a0cd2e

File tree

2 files changed

+14
-2
lines changed
  • go/ql/test/library-tests/semmle/go/frameworks/SQL

2 files changed

+14
-2
lines changed

go/ql/test/library-tests/semmle/go/frameworks/SQL/squirrel.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package main
22

3-
//go:generate depstubber -vendor github.com/Masterminds/squirrel DeleteBuilder,InsertBuilder,SelectBuilder,UpdateBuilder Delete,Expr,Insert,Select,Update
3+
//go:generate depstubber -vendor github.com/Masterminds/squirrel DeleteBuilder,Eq,InsertBuilder,SelectBuilder,UpdateBuilder Delete,Expr,Insert,Select,Update
44

55
import (
66
"github.com/Masterminds/squirrel"
@@ -44,4 +44,10 @@ func squirrelTest(querypart string) {
4444
updateBuilder.Where(querypart) // $ querystring=querypart
4545
updateBuilder.Set(querypart, "") // $ querystring=querypart
4646
updateBuilder.Table(querypart) // $ querystring=querypart
47+
48+
// safe
49+
wrapped := squirrel.Eq{"id": querypart}
50+
deleteBuilder.Where(wrapped)
51+
selectBuilder.Where(wrapped)
52+
updateBuilder.Where(wrapped)
4753
}

go/ql/test/library-tests/semmle/go/frameworks/SQL/vendor/github.com/Masterminds/squirrel/stub.go

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)