Skip to content

Commit

Permalink
Omit empty variants types.
Browse files Browse the repository at this point in the history
  • Loading branch information
q-uint committed Feb 9, 2025
1 parent c9cafc1 commit cd41382
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gen/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ func (g *Generator) dataToString(prefix string, data did.Data) string {
}
var record string
for _, r := range records {
record += fmt.Sprintf("\t%-*s *%-*s `ic:\"%s,variant\"`\n", sizeName, r.name, sizeType, r.typ, r.originalName)
record += fmt.Sprintf("\t%-*s *%-*s `ic:\"%s,variant\" json:\"%s,omitempty\"`\n", sizeName, r.name, sizeType, r.typ, r.originalName, r.originalName)
}
return fmt.Sprintf("struct {\n%s}", record)
case did.Vector:
Expand Down

0 comments on commit cd41382

Please sign in to comment.