[
https://issues.apache.org/jira/browse/THRIFT-3160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14555097#comment-14555097
]
Hudson commented on THRIFT-3160:
--------------------------------
SUCCESS: Integrated in Thrift #1561 (See
[https://builds.apache.org/job/Thrift/1561/])
THRIFT-3160 go: make generated enum types implement TextMarshaler and
TextUnmarshaler (jensg: rev 549a9e1e6dfbfaf1f7685dc5e26440c501517738)
* lib/go/test/tests/encoding_json_test.go
* compiler/cpp/src/generate/t_go_generator.cc
> Make generated go enums implement TextMarshaller and TextUnmarshaller
> interfaces
> --------------------------------------------------------------------------------
>
> Key: THRIFT-3160
> URL: https://issues.apache.org/jira/browse/THRIFT-3160
> Project: Thrift
> Issue Type: Improvement
> Components: Go - Compiler
> Affects Versions: 0.9.2
> Reporter: Konstantin Shaposhnikov
> Assignee: Konstantin Shaposhnikov
> Fix For: 0.9.3
>
>
> This will make JSON encoder/decoders use string representation instead of
> meaningless numbers.
> The new generated code will looks like:
> {code}
> func (p TestEnum) MarshalText() ([]byte, error) {
> return []byte(p.String()), nil
> }
> func (p *TestEnum) UnmarshalText(text []byte) error {
> x, err := TestEnumFromString(string(text))
> *p = x
> return err
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)