// Unmarshal will unmarshall data in format f into an interface{}.
// This is what's needed for Hugo's /data handling.
962969
func (d Decoder) Unmarshal(data []byte, f Format) (interface{}, error) {
	if data == nil {
		switch f {
		case CSV:
			return make([][]string, 0), nil
		default:
			return make(map[string]interface{}), nil
		}

	}
	var v interface{}
	err := d.unmarshal(data, f, &v)

	return v, err
}
224088
func (s *Serializer) Unmarshal(data []byte, v interface{}) error {
	pb, ok := v.(proto.Message)
	if !ok {
		return constants.ErrWrongValueType
	}
	return proto.Unmarshal(data, pb)
}
443336
func (b *BoolOption) Unmarshal(data []byte) error {
	protoValue := &BoolValue{}
	err := proto.Unmarshal(data, protoValue)
	if err != nil {
		return err
	}
	b.Value = protoValue.Value
	return nil
}
536759
func Unmarshal(data []byte, v interface{}) error {
	table, err := toml.Parse(data)
	if err != nil {
		return err
	}

	if err := toml.UnmarshalTable(table, v); err != nil {
		return err
	}

	if err := applyDefault(reflect.ValueOf(v), false); err != nil {
		return err
	}
	return nil
}
568684
func Unmarshal(data []byte) (geom.T, error) {
	return Read(bytes.NewBuffer(data))
}
578831
func (StdJSON) Unmarshal(data []byte, v interface{}) error {
	return json.Unmarshal(data, v)
}
113238
func Unmarshal(data url.Values, v interface{}) error {
	var d decoder
	d.init(data)
	return d.unmarshal(v)
}
898361
func (customCodec) Unmarshal(data []byte, obj interface{}) error {
	switch value := obj.(type) {
	case *[]byte:
		*value = data
		return nil
	default:
		return newCustomCodecUnmarshalCastError(obj)
	}
}
396707
func (key *AES128Key) Unmarshal(data []byte) error {
	*key = [16]byte{} // Reset the receiver
	return key.UnmarshalBinary(data)
}
867037
func (j *JSONPb) Unmarshal(data []byte, v interface{}) error {
	return unmarshalJSONPb(data, v)
}
622835
func unmarshal(data []byte, container ConfigContainer) error {
	unmarshalFunc := func(v interface{}) error {
		return config.Unmarshal(data, v)
	}

	var err error
	unmarshaller, ok := container.(Unmarshaller)
	if ok {
		err = unmarshaller.Unmarshal(unmarshalFunc)
	} else {
		err = unmarshalFunc(container)
	}
	return err
}
783512
func (p ProtobufImpl) Unmarshal(marshaled []byte, msg proto.Message) error {
	return errors.WithStack(proto.Unmarshal(marshaled, msg))
}
1213229
func (key *AppSKey) Unmarshal(data []byte) error {
	*key = [16]byte{} // Reset the receiver
	return key.UnmarshalBinary(data)
}
722369
func Unmarshal(data []byte, v interface{}) error {
	err := json.Unmarshal(data, v)
	if err != nil {
		return err
	}

	if ImplementsPostJSONUnmarshaler(v) {
		err := v.(PostJSONUnmarshaler).PostUnmarshalJSON()
		if err != nil {
			return err
		}
	}

	return nil
}
862465
func (l *Traits) Unmarshal(data []byte) error {
	protoValues := &LabelValues{}
	err := proto.Unmarshal(data, protoValues)
	if err != nil {
		return err
	}
	if protoValues.Values == nil {
		return nil
	}
	*l = make(map[string][]string, len(protoValues.Values))
	for key := range protoValues.Values {
		(*l)[key] = protoValues.Values[key].Values
	}
	return nil
}
403940
func (n *AppNonce) Unmarshal(data []byte) error {
	*n = [3]byte{} // Reset the receiver
	return n.UnmarshalBinary(data)
}
1102994
func (pvt *PvtDataCollections) Unmarshal(data [][]byte) error {
	for _, each := range data {
		payload := &gossip.PvtDataPayload{}
		if err := proto.Unmarshal(each, payload); err != nil {
			return err
		}
		pvtRWSet := &rwset.TxPvtReadWriteSet{}
		if err := proto.Unmarshal(payload.Payload, pvtRWSet); err != nil {
			return err
		}
		*pvt = append(*pvt, &ledger.TxPvtData{
			SeqInBlock: payload.TxSeqInBlock,
			WriteSet:   pvtRWSet,
		})
	}

	return nil
}