Skip to content

Commit

Permalink
add embedded fields to stdlib template
Browse files Browse the repository at this point in the history
  • Loading branch information
nickjackson committed Jun 1, 2022
1 parent dfc8ab5 commit 0e9aa79
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/codegen/golang/templates/stdlib/queryCode.tmpl
Expand Up @@ -13,7 +13,10 @@ type {{.Arg.Type}} struct { {{- range .Arg.UniqueFields}}
{{end}}

{{if .Ret.EmitStruct}}
type {{.Ret.Type}} struct { {{- range .Ret.Struct.Fields}}
type {{.Ret.Type}} struct { {{- range .Ret.Struct.EmbedFields}}
{{.Name}} {{.Type}} {{if $.EmitJSONTags}}{{$.Q}}{{.Tag}}{{$.Q}}{{end}}
{{- end}}
{{- range .Ret.Struct.Fields}}
{{.Name}} {{.Type}} {{if or ($.EmitJSONTags) ($.EmitDBTags)}}{{$.Q}}{{.Tag}}{{$.Q}}{{end}}
{{- end}}
}
Expand Down

0 comments on commit 0e9aa79

Please sign in to comment.