Skip to content

Commit

Permalink
Merge pull request hooklift#142 from bbesser/fix/generate-arrays
Browse files Browse the repository at this point in the history
support generating arrays of simple types
  • Loading branch information
c4milo authored Apr 15, 2019
2 parents a06bd6b + fb2baad commit e635d3c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion types_tmpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ var typesTmpl = `
{{define "SimpleType"}}
{{$type := replaceReservedWords .Name | makePublic}}
{{if .Doc}} {{.Doc | comment}} {{end}}
type {{$type}} {{toGoType .Restriction.Base}}
{{if ne .List.ItemType ""}}
type {{$type}} []{{toGoType .List.ItemType }}
{{else}}
type {{$type}} {{toGoType .Restriction.Base}}
{{end}}
{{if .Restriction.Enumeration}}
const (
{{with .Restriction}}
Expand Down

0 comments on commit e635d3c

Please sign in to comment.