Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
0.9.3
-
None
Description
Template:
struct TaskQuery { 4: optional set<string> taskIds }
renders in Golang as :
TaskIds map[string]bool `thrift:"taskIds,4" json:"taskIds,omitempty"`
In Golang, the default value for a map is simply an empty map and not nil, but the optional check
func (p *TaskQuery) IsSetTaskIds() bool {
return p.TaskIds != nil
}
checks against nil instead if an empty map
Attachments
Issue Links
- is part of
-
THRIFT-4011 Sets of Thrift structs generate Go code that can't be serialized to JSON
- Closed
- is related to
-
THRIFT-3752 nil collections are serialized as empty collections
- In Progress