Skip to content

Commit

Permalink
Merge pull request hooklift#226 from w65536/simple-pointer-types
Browse files Browse the repository at this point in the history
Type definitions stemming from simple types must not be pointer types
  • Loading branch information
c4milo authored Dec 3, 2021
2 parents d91c993 + 14f4362 commit 47ec413
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions types_tmpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ var typesTmpl = `
{{$typeName := replaceReservedWords .Name | makePublic}}
{{if .Doc}} {{.Doc | comment}} {{end}}
{{if ne .List.ItemType ""}}
type {{$typeName}} []{{toGoType .List.ItemType false}}
type {{$typeName}} []{{toGoType .List.ItemType false | removePointerFromType}}
{{else if ne .Union.MemberTypes ""}}
type {{$typeName}} string
{{else if .Union.SimpleType}}
type {{$typeName}} string
{{else if .Restriction.Base}}
type {{$typeName}} {{toGoType .Restriction.Base false}}
type {{$typeName}} {{toGoType .Restriction.Base false | removePointerFromType}}
{{else}}
type {{$typeName}} interface{}
{{end}}
Expand Down Expand Up @@ -140,13 +140,13 @@ var typesTmpl = `
{{with .SimpleType}}
{{if .Doc}} {{.Doc | comment}} {{end}}
{{if ne .List.ItemType ""}}
type {{$typeName}} []{{toGoType .List.ItemType false}}
type {{$typeName}} []{{toGoType .List.ItemType false | removePointerFromType}}
{{else if ne .Union.MemberTypes ""}}
type {{$typeName}} string
{{else if .Union.SimpleType}}
type {{$typeName}} string
{{else if .Restriction.Base}}
type {{$typeName}} {{toGoType .Restriction.Base false}}
type {{$typeName}} {{toGoType .Restriction.Base false | removePointerFromType}}
{{else}}
type {{$typeName}} interface{}
{{end}}
Expand Down

0 comments on commit 47ec413

Please sign in to comment.