Skip to content

Commit 0e9aa79

Browse files
committed
add embedded fields to stdlib template
1 parent dfc8ab5 commit 0e9aa79

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

internal/codegen/golang/templates/stdlib/queryCode.tmpl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ type {{.Arg.Type}} struct { {{- range .Arg.UniqueFields}}
1313
{{end}}
1414

1515
{{if .Ret.EmitStruct}}
16-
type {{.Ret.Type}} struct { {{- range .Ret.Struct.Fields}}
16+
type {{.Ret.Type}} struct { {{- range .Ret.Struct.EmbedFields}}
17+
{{.Name}} {{.Type}} {{if $.EmitJSONTags}}{{$.Q}}{{.Tag}}{{$.Q}}{{end}}
18+
{{- end}}
19+
{{- range .Ret.Struct.Fields}}
1720
{{.Name}} {{.Type}} {{if or ($.EmitJSONTags) ($.EmitDBTags)}}{{$.Q}}{{.Tag}}{{$.Q}}{{end}}
1821
{{- end}}
1922
}

0 commit comments

Comments
 (0)