Skip to content

Commit

Permalink
Fix trim last separator (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
cristaloleg authored Mar 13, 2024
1 parent d4c2d1b commit 299d3cd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
7 changes: 2 additions & 5 deletions builq.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,8 @@ func (b *Builder) build() (_ string, _ []any) {
b.setErr(err)
}

// drop last separator for clarity.
q := query.String()
if q[len(q)-1] == b.sep {
q = q[:len(q)-1]
}
// drop last separators for clarity.
q := strings.TrimRight(query.String(), string(b.sep))
return q, resArgs
}

Expand Down
1 change: 0 additions & 1 deletion example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ func ExampleNew() {
// SELECT foo, bar FROM users
// WHERE active IS TRUE
// AND user_id = $1 OR user = $2
//
// args:
// [42 root]
// debug:
Expand Down

0 comments on commit 299d3cd

Please sign in to comment.