THRIFT-5650: Implement UUID in Go compiler

Client: go
diff --git a/lib/go/test/EqualsTest.thrift b/lib/go/test/EqualsTest.thrift
index 57ce131..1732f31 100644
--- a/lib/go/test/EqualsTest.thrift
+++ b/lib/go/test/EqualsTest.thrift
@@ -20,6 +20,7 @@
 typedef i8 mybyte
 typedef string mystr
 typedef binary mybin
+typedef uuid myuuid
 
 enum EnumFoo {
   e1
@@ -51,6 +52,10 @@
   22: optional mystr OptMyStrFoo,
   23: mybin MyBinFoo,
   24: optional mybin OptMyBinFoo,
+  25: uuid UUIDFoo,
+  26: optional uuid OptUUIDFoo,
+  27: myuuid MyUUIDFoo,
+  28: optional myuuid OptMyUUIDFoo,
 }
 
 struct StructEqualsFoo {
@@ -79,6 +84,10 @@
     18: optional list<mystr> OptMyStrListFoo,
     19: list<mybin> MyBinListFoo,
     20: optional list<mybin> OptMyBinListFoo,
+    21: list<uuid> UUIDListFoo,
+    22: optional list<uuid> OptUUIDListFoo,
+    23: list<myuuid> MyUUIDListFoo,
+    24: optional list<myuuid> OptMyUUIDListFoo,
 }
 
 struct SetEqualsFoo {
@@ -102,6 +111,10 @@
     18: optional set<mystr> OptMyStrSetFoo,
     19: set<mybin> MyBinSetFoo,
     20: optional set<mybin> OptMyBinSetFoo,
+    21: set<uuid> UUIDSetFoo,
+    22: optional set<uuid> OptUUIDSetFoo,
+    23: set<myuuid> MyUUIDSetFoo,
+    24: optional set<myuuid> OptMyUUIDSetFoo,
 }
 
 struct MapEqualsFoo {
@@ -125,4 +138,8 @@
     18: optional map<i64, mybyte> OptInt64MyByteMapFoo,
     19: map<mybyte, i64> MyByteInt64MapFoo,
     20: optional map<mybyte, i64> OptMyByteInt64MapFoo,
+    21: map<i64, uuid> UUIDMapFoo,
+    22: optional map<i64, uuid> OptUUIDMapFoo,
+    23: map<i64, myuuid> MyUUIDMapFoo,
+    24: optional map<i64, myuuid> OptMyUUIDMapFoo,
 }
diff --git a/lib/go/test/tests/equals_test.go b/lib/go/test/tests/equals_test.go
index 3bd14b6..b8adc77 100644
--- a/lib/go/test/tests/equals_test.go
+++ b/lib/go/test/tests/equals_test.go
@@ -23,9 +23,16 @@
 	"strconv"
 	"testing"
 
+	"github.com/apache/thrift/lib/go/thrift"
+
 	"github.com/apache/thrift/lib/go/test/gopath/src/equalstest"
 )
 
+var (
+	equalstestUUID1 = thrift.Must(thrift.ParseTuuid("6ba7b810-9dad-11d1-80b4-00c04fd430c8"))
+	equalstestUUID2 = thrift.Must(thrift.ParseTuuid("6ba7b811-9dad-11d1-80b4-00c04fd430c8"))
+)
+
 func TestEquals(t *testing.T) {
 	// test basic field
 	basicTgt, basicSrc := genBasicFoo(), genBasicFoo()
@@ -117,19 +124,19 @@
 func genBasicFoo() *equalstest.BasicEqualsFoo {
 	return &equalstest.BasicEqualsFoo{
 		BoolFoo:      true,
-		OptBoolFoo:   &(&struct{ x bool }{true}).x,
+		OptBoolFoo:   thrift.BoolPtr(true),
 		I8Foo:        1,
-		OptI8Foo:     &(&struct{ x int8 }{1}).x,
+		OptI8Foo:     thrift.Int8Ptr(1),
 		I16Foo:       2,
-		OptI16Foo:    &(&struct{ x int16 }{2}).x,
+		OptI16Foo:    thrift.Int16Ptr(2),
 		I32Foo:       3,
-		OptI32Foo:    &(&struct{ x int32 }{3}).x,
+		OptI32Foo:    thrift.Int32Ptr(3),
 		I64Foo:       4,
-		OptI64Foo:    &(&struct{ x int64 }{4}).x,
+		OptI64Foo:    thrift.Int64Ptr(4),
 		DoubleFoo:    5,
-		OptDoubleFoo: &(&struct{ x float64 }{5}).x,
+		OptDoubleFoo: thrift.Float64Ptr(6),
 		StrFoo:       "6",
-		OptStrFoo:    &(&struct{ x string }{"6"}).x,
+		OptStrFoo:    thrift.StringPtr("6"),
 		BinFoo:       []byte("7"),
 		OptBinFoo:    []byte("7"),
 		EnumFoo:      equalstest.EnumFoo_e1,
@@ -140,6 +147,10 @@
 		OptMyStrFoo:  equalstest.MystrPtr(equalstest.Mystr("9")),
 		MyBinFoo:     equalstest.Mybin("10"),
 		OptMyBinFoo:  equalstest.Mybin("10"),
+		UUIDFoo:      equalstestUUID1,
+		OptUUIDFoo:   thrift.TuuidPtr(equalstestUUID1),
+		MyUUIDFoo:    equalstest.Myuuid(equalstestUUID1),
+		OptMyUUIDFoo: equalstest.MyuuidPtr(equalstest.Myuuid(equalstestUUID1)),
 	}
 }
 
@@ -172,6 +183,10 @@
 		OptMyStrListFoo:        []equalstest.Mystr{equalstest.Mystr("6"), equalstest.Mystr("5"), equalstest.Mystr("4"), equalstest.Mystr("3"), equalstest.Mystr("2"), equalstest.Mystr("1")},
 		MyBinListFoo:           []equalstest.Mybin{equalstest.Mybin("6"), equalstest.Mybin("5"), equalstest.Mybin("4"), equalstest.Mybin("3"), equalstest.Mybin("2"), equalstest.Mybin("1")},
 		OptMyBinListFoo:        []equalstest.Mybin{equalstest.Mybin("6"), equalstest.Mybin("5"), equalstest.Mybin("4"), equalstest.Mybin("3"), equalstest.Mybin("2"), equalstest.Mybin("1")},
+		UUIDListFoo:            []thrift.Tuuid{equalstestUUID1, equalstestUUID2},
+		OptUUIDListFoo:         []thrift.Tuuid{equalstestUUID1, equalstestUUID2},
+		MyUUIDListFoo:          []equalstest.Myuuid{equalstest.Myuuid(equalstestUUID1), equalstest.Myuuid(equalstestUUID2)},
+		OptMyUUIDListFoo:       []equalstest.Myuuid{equalstest.Myuuid(equalstestUUID1), equalstest.Myuuid(equalstestUUID2)},
 	}
 }
 
@@ -197,6 +212,10 @@
 		OptMyStrSetFoo:        []equalstest.Mystr{equalstest.Mystr("6"), equalstest.Mystr("5"), equalstest.Mystr("4"), equalstest.Mystr("3"), equalstest.Mystr("2"), equalstest.Mystr("1")},
 		MyBinSetFoo:           []equalstest.Mybin{equalstest.Mybin("6"), equalstest.Mybin("5"), equalstest.Mybin("4"), equalstest.Mybin("3"), equalstest.Mybin("2"), equalstest.Mybin("1")},
 		OptMyBinSetFoo:        []equalstest.Mybin{equalstest.Mybin("6"), equalstest.Mybin("5"), equalstest.Mybin("4"), equalstest.Mybin("3"), equalstest.Mybin("2"), equalstest.Mybin("1")},
+		UUIDSetFoo:            []thrift.Tuuid{equalstestUUID1, equalstestUUID2},
+		OptUUIDSetFoo:         []thrift.Tuuid{equalstestUUID1, equalstestUUID2},
+		MyUUIDSetFoo:          []equalstest.Myuuid{equalstest.Myuuid(equalstestUUID1), equalstest.Myuuid(equalstestUUID2)},
+		OptMyUUIDSetFoo:       []equalstest.Myuuid{equalstest.Myuuid(equalstestUUID1), equalstest.Myuuid(equalstestUUID2)},
 	}
 }
 
@@ -227,6 +246,10 @@
 		OptInt64MyByteMapFoo:     map[int64]equalstest.Mybyte{6: equalstest.Mybyte(6), 5: equalstest.Mybyte(5), 4: equalstest.Mybyte(4), 3: equalstest.Mybyte(3), 2: equalstest.Mybyte(2), 1: equalstest.Mybyte(1)},
 		MyByteInt64MapFoo:        map[equalstest.Mybyte]int64{equalstest.Mybyte(6): 6, equalstest.Mybyte(5): 5, equalstest.Mybyte(4): 4, equalstest.Mybyte(3): 3, equalstest.Mybyte(2): 2, equalstest.Mybyte(1): 1},
 		OptMyByteInt64MapFoo:     map[equalstest.Mybyte]int64{equalstest.Mybyte(6): 6, equalstest.Mybyte(5): 5, equalstest.Mybyte(4): 4, equalstest.Mybyte(3): 3, equalstest.Mybyte(2): 2, equalstest.Mybyte(1): 1},
+		UUIDMapFoo:               map[int64]thrift.Tuuid{1: equalstestUUID1, 2: equalstestUUID2},
+		OptUUIDMapFoo:            map[int64]thrift.Tuuid{1: equalstestUUID1, 2: equalstestUUID2},
+		MyUUIDMapFoo:             map[int64]equalstest.Myuuid{1: equalstest.Myuuid(equalstestUUID1), 2: equalstest.Myuuid(equalstestUUID2)},
+		OptMyUUIDMapFoo:          map[int64]equalstest.Myuuid{1: equalstest.Myuuid(equalstestUUID1), 2: equalstest.Myuuid(equalstestUUID2)},
 	}
 }