Skip to content

Commit 8d40c49

Browse files
committed
Creates nested structs for dealing with nested elements. Closes #16
So, instead of inlining nested elements we represent them using nested structs in Go. This is more idiomatic and avoids naming clashes.
1 parent 66ebe2b commit 8d40c49

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

generator/types_tmpl.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ var typesTmpl = `
7777
{{end}}
7878
7979
{{define "ComplexTypeInline"}}
80+
{{replaceReservedWords .Name | makePublic}} struct {
8081
{{with .ComplexType}}
8182
{{if ne .ComplexContent.Extension.Base ""}}
8283
{{template "ComplexContent" .ComplexContent}}
@@ -89,6 +90,7 @@ var typesTmpl = `
8990
{{template "Attributes" .Attributes}}
9091
{{end}}
9192
{{end}}
93+
} ` + "`" + `xml:"{{.Name}},omitempty"` + "`" + `
9294
{{end}}
9395
9496
{{define "Elements"}}

0 commit comments

Comments
 (0)