THRIFT-3998 Document ability to add custom tags to thrift structs

Client: Go
Patch: Richard Artoul <richardartoul@gmail.com>

This closes #1053
This commit is contained in:
Richard Artoul 2016-07-22 14:26:53 -07:00 committed by Jens Geyer
parent 7ab125a253
commit c3a3f653b6

View File

@ -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"`
}