Skip to content
Merged
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
6 changes: 5 additions & 1 deletion thrift/decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ import (
// The function errors if the data in b does not match the type of v.
//
// The function panics if v cannot be converted to a thrift representation.
//
// As an optimization, the value passed in v may be reused across multiple calls
// to Unmarshal, allowing the function to reuse objects referenced by pointer
// fields of struct values. When reusing objects, the application is responsible
// for resetting the state of v before calling Unmarshal again.
func Unmarshal(p Protocol, b []byte, v interface{}) error {
br := bytes.NewReader(b)
pr := p.NewReader(br)
Expand Down Expand Up @@ -347,7 +352,6 @@ type structDecoder struct {
}

func (dec *structDecoder) decode(r Reader, v reflect.Value, flags flags) error {
v.Set(dec.zero)
flags = flags.only(decodeFlags)
coalesceBoolFields := flags.have(coalesceBoolFields)

Expand Down