summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Artoul <richardartoul@gmail.com>2016-07-22 14:26:53 -0700
committerJens Geyer <jensg@apache.org>2016-12-10 01:54:54 +0100
commitc3a3f653b66b7cccf61c936dc349de27b8a18899 (patch)
treee2f6bb5bc2df0d396c03e734f7f97163a071c40e
parent7ab125a253e5aebbf2a0ed9a0a1602a4b879eca7 (diff)
downloadthrift-c3a3f653b66b7cccf61c936dc349de27b8a18899.tar.gz
THRIFT-3998 Document ability to add custom tags to thrift structs
Client: Go Patch: Richard Artoul <richardartoul@gmail.com> This closes #1053
-rw-r--r--lib/go/README.md15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/go/README.md b/lib/go/README.md
index 1e1434240..7440474c3 100644
--- a/lib/go/README.md
+++ b/lib/go/README.md
@@ -64,3 +64,18 @@ As such, we provide some helpers that do just this under lib/go/thrift/. E.g.,
And so on. The code generator also creates analogous helpers for user-defined
typedefs and enums.
+
+Adding custom tags to generated Thrift structs
+==============================================
+
+You can add tags to the auto-generated thrift structs using the following format:
+
+ struct foo {
+ 1: required string Bar (go.tag = "some_tag:\"some_tag_value\"")
+ }
+
+which will generate:
+
+ type Foo struct {
+ Bar string `thrift:"bar,1,required" some_tag:"some_tag_value"`
+ }