diff options
author | Yuxuan 'fishy' Wang <yuxuan.wang@reddit.com> | 2022-10-21 10:27:40 -0700 |
---|---|---|
committer | Yuxuan 'fishy' Wang <fishywang@gmail.com> | 2022-10-26 14:40:10 -0700 |
commit | 2acfe0fc7a1747c327da66c8a693840ba0c5a016 (patch) | |
tree | f07b250964c0295a9d9908bb20e8e2028c9fed1f /test/ConstantsDemo.thrift | |
parent | cea5559ecf458ccbb251594dba571f01bf0a2402 (diff) | |
download | thrift-2acfe0fc7a1747c327da66c8a693840ba0c5a016.tar.gz |
THRIFT-5650: Implement UUID in Go compiler
Client: go
Diffstat (limited to 'test/ConstantsDemo.thrift')
-rw-r--r-- | test/ConstantsDemo.thrift | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/test/ConstantsDemo.thrift b/test/ConstantsDemo.thrift index 2245657f6..8fac6db93 100644 --- a/test/ConstantsDemo.thrift +++ b/test/ConstantsDemo.thrift @@ -20,11 +20,16 @@ namespace cpp yozone namespace erl consts_ namespace haxe constantsDemo +namespace go constantsdemo + +typedef uuid myUUID struct thing { 1: i32 hello, 2: i32 goodbye 3: uuid id + 4: myUUID my_id + 5: optional myUUID my_optional_id } enum enumconstants { @@ -51,12 +56,15 @@ const double GEn_DU = 085.2355 const string GEN_STRING = "asldkjasfd" const double e10 = 1e10 // fails with 0.9.3 and earlier -const double e11 = -1e10 +const double e11 = -1e10 // uuids are accepted with or without curly braces const uuid GEN_UUID = '00000000-4444-CCCC-ffff-0123456789ab' const uuid GEN_GUID = '{00112233-4455-6677-8899-aaBBccDDeeFF}' +const myUUID MY_UUID = '00000000-4444-CCCC-ffff-0123456789ab' +const myUUID MY_GUID = '{00112233-4455-6677-8899-aaBBccDDeeFF}' + const map<i32,i32> GEN_MAP = { 35532 : 233, 43523 : 853 } const list<i32> GEN_LIST = [ 235235, 23598352, 3253523 ] @@ -64,9 +72,9 @@ const map<i32, map<i32, i32>> GEN_MAPMAP = { 235 : { 532 : 53255, 235:235}} const map<string,i32> GEN_MAP2 = { "hello" : 233, "lkj98d" : 853, 'lkjsdf' : 098325 } -const thing GEN_THING = { 'hello' : 325, 'goodbye' : 325352, 'id' : '{00112233-4455-6677-8899-aaBBccDDeeFF}' } +const thing GEN_THING = { 'hello' : 325, 'goodbye' : 325352, 'id' : '{00112233-4455-6677-8899-aaBBccDDeeFF}', 'my_id': '00000000-4444-CCCC-ffff-0123456789ab', 'my_optional_id': '00000000-4444-CCCC-ffff-0123456789ab' } -const map<i32,thing> GEN_WHAT = { 35 : { 'hello' : 325, 'goodbye' : 325352, 'id' : '00000000-4444-CCCC-ffff-0123456789ab' } } +const map<i32,thing> GEN_WHAT = { 35 : { 'hello' : 325, 'goodbye' : 325352, 'id' : '00000000-4444-CCCC-ffff-0123456789ab', 'my_id': '00000000-4444-CCCC-ffff-0123456789ab', 'my_optional_id': '00000000-4444-CCCC-ffff-0123456789ab' } } const set<i32> GEN_SET = [ 235, 235, 53235 ] |