Skip to content

Commit

Permalink
Do not use pointer reference, when optional element is of GoType string
Browse files Browse the repository at this point in the history
  • Loading branch information
isimluk committed May 30, 2020
1 parent 9350718 commit 0972456
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/xsd/element.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func (e *Element) GoMemLayout() string {
if e.MaxOccurs == "unbounded" {
return "[]"
}
if e.MaxOccurs == "1" && e.MinOccurs == "0" {
if e.MaxOccurs == "1" && e.MinOccurs == "0" && e.GoTypeName() != "string" {
return "*"
}
return ""
Expand Down

0 comments on commit 0972456

Please # to comment.