Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions thrift/thrift.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,14 +252,15 @@ func encodeFields(t reflect.Type) structMeta {
continue
}
id, opts := parseTag(tv)
if id >= 64 {
// TODO: figure out a better way to deal with this
panic("thrift: field id must be < 64")
}
ef.id = id
ef.name = f.Name
ef.required = opts.Contains("required")
if ef.required {
if id >= 64 {
// TODO: figure out a better way to deal with this
panic("thrift: field id must be < 64")
}

m.required |= 1 << byte(id)
}
ef.keepEmpty = opts.Contains("keepempty")
Expand Down