From e85e61b1993773b371dda5d6fd3b1c7e49a3a966 Mon Sep 17 00:00:00 2001 From: Matt Jones Date: Mon, 12 Oct 2015 10:29:12 -0700 Subject: [PATCH] support Pointers --- generator/go.go | 2 +- generator/main.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/generator/go.go b/generator/go.go index 8a863c0..7886c5d 100644 --- a/generator/go.go +++ b/generator/go.go @@ -180,7 +180,7 @@ func (g *GoGenerator) formatType(pkg string, thrift *parser.Thrift, typ *parser. valueType := g.formatKeyType(pkg, thrift, typ.ValueType) return "map[" + valueType + "]struct{}" case "list": - return "[]" + g.formatType(pkg, thrift, typ.ValueType, 0) + return "[]" + g.formatType(pkg, thrift, typ.ValueType, toNoPointer) case "map": keyType := g.formatKeyType(pkg, thrift, typ.KeyType) return "map[" + keyType + "]" + g.formatType(pkg, thrift, typ.ValueType, toNoPointer) diff --git a/generator/main.go b/generator/main.go index 7197270..bfd7723 100644 --- a/generator/main.go +++ b/generator/main.go @@ -89,6 +89,7 @@ func main() { generator := &GoGenerator{ ThriftFiles: parsedThrift, Format: true, + Pointers: *flagGoPointers, } err = generator.Generate(outpath) if err != nil {