Skip to content

Commit 1f45dcc

Browse files
committed
Write out unions
Unions are the same as structs, so reuse writeStruct
1 parent 65f27bc commit 1f45dcc

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

generator/go.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,13 @@ func (g *GoGenerator) generateSingle(out io.Writer, thriftPath string, thrift *p
649649
}
650650
}
651651

652+
for _, k := range sortedKeys(thrift.Unions) {
653+
un := thrift.Unions[k]
654+
if err := g.writeStruct(out, un); err != nil {
655+
g.error(err)
656+
}
657+
}
658+
652659
for _, k := range sortedKeys(thrift.Services) {
653660
svc := thrift.Services[k]
654661
if err := g.writeService(out, svc); err != nil {

0 commit comments

Comments
 (0)