[ https://issues.apache.org/jira/browse/THRIFT-3700?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15208543#comment-15208543 ]
John Sirois commented on THRIFT-3700: ------------------------------------- [~connorgorman] - I filed THRIFT-3752 today which is very similar - down to the underlying thrift-using project in question! My bug may be dup to yours, but the specific problem I found was on the serialization side of things. If you have tie to read that bug report and comment on the mergeability of these two issues, I'd be grateful. I'm working on a fix for THRIFT-3752 currently and wouldn't mind knocking off a fix for this issue too. > Go Map has wrong default value when optional > -------------------------------------------- > > Key: THRIFT-3700 > URL: https://issues.apache.org/jira/browse/THRIFT-3700 > Project: Thrift > Issue Type: Bug > Components: Go - Compiler > Affects Versions: 0.9.3 > Reporter: Connor Gorman > > Template: > {code} > struct TaskQuery { > 4: optional set<string> taskIds > } > {code} > renders in Golang as : > {code} > TaskIds map[string]bool `thrift:"taskIds,4" json:"taskIds,omitempty"` > {code} > In Golang, the default value for a map is simply an empty map and not nil, > but the optional check > {code} > func (p *TaskQuery) IsSetTaskIds() bool { > return p.TaskIds != nil > } > {code} > checks against nil instead if an empty map -- This message was sent by Atlassian JIRA (v6.3.4#6332)