Skip to content

Commit

Permalink
Creates nested structs for dealing with nested elements. Closes #16
Browse files Browse the repository at this point in the history
So, instead of inlining nested elements we represent them using nested
structs in Go. This is more idiomatic and avoids naming clashes.
  • Loading branch information
c4milo committed Jan 17, 2015
1 parent 66ebe2b commit 8d40c49
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions generator/types_tmpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ var typesTmpl = `
{{end}}
{{define "ComplexTypeInline"}}
{{replaceReservedWords .Name | makePublic}} struct {
{{with .ComplexType}}
{{if ne .ComplexContent.Extension.Base ""}}
{{template "ComplexContent" .ComplexContent}}
Expand All @@ -89,6 +90,7 @@ var typesTmpl = `
{{template "Attributes" .Attributes}}
{{end}}
{{end}}
} ` + "`" + `xml:"{{.Name}},omitempty"` + "`" + `
{{end}}
{{define "Elements"}}
Expand Down

0 comments on commit 8d40c49

Please sign in to comment.