Skip to content

Commit

Permalink
fix(tpl): struct pointer reference
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesjwarren committed Jun 18, 2018
1 parent 14e9e2f commit 17c3615
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tmpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)
{{range .Tokens}}
func {{$.Visibility}}can{{title .Name}}(r *sql.Row) (*{{pkg .Name}}, error) {
var s *{{pkg .Name}}
s := &{{pkg .Name}}{}
if err := r.Scan({{range .Fields}}
&s.{{.Name}},{{end}}
); err != nil {
Expand All @@ -24,7 +24,7 @@ func {{$.Visibility}}can{{title .Name}}s(rs *sql.Rows) ([]*{{pkg .Name}}, error)
structs := make([]*{{pkg .Name}}, 0, 16)
var err error
for rs.Next() {
var s *{{pkg .Name}}
s := &{{pkg .Name}}{}
if err = rs.Scan({{range .Fields}}
&s.{{.Name}},{{end}}
); err != nil {
Expand Down

0 comments on commit 17c3615

Please sign in to comment.