mirror of
https://github.com/valitydev/thrift.git
synced 2024-11-07 02:45:22 +00:00
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:
parent
7ab125a253
commit
c3a3f653b6
@ -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"`
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user