Skip to content

Commit

Permalink
database/sql: force users of NamedParam to name struct literals fields
Browse files Browse the repository at this point in the history
Or they can use sql.Param instead.

Change-Id: Icf21dbcc87170635c3f5d3f49736429a37abe9da
Reviewed-on: https://go-review.googlesource.com/33576
Run-TryBot: Brad Fitzpatrick <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
Reviewed-by: Daniel Theophanes <[email protected]>
Reviewed-by: Minux Ma <[email protected]>
  • Loading branch information
bradfitz committed Nov 24, 2016
1 parent a2bd5c5 commit f7b2f58
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/database/sql/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ func Drivers() []string {
// NamedParam may be passed into query parameter arguments to associate
// a named placeholder with a value.
type NamedParam struct {
_Named_Fields_Required struct{}

// Name of the parameter placeholder. If empty the ordinal position in the
// argument list will be used.
Name string
Expand Down

0 comments on commit f7b2f58

Please sign in to comment.