// UnmarshalFlag satisfies go-flags flag interface
15825
func (p *Pointer) UnmarshalFlag(data string) error {
	ptr, err := NewPointerFromString(data)
	if err != nil {
		return err
	}

	*p = ptr

	return nil
}
1176260
func (marshaler *DefaultEnvMarshaler) unmarshalField(
	fieldStruct reflect.StructField,
	structFieldVal reflect.Value,
	fieldEnvTag string,
	parser *DefaultParser,
) error {
	structFieldType := structFieldVal.Type()
	fieldName := fieldStruct.Name

	if structFieldType.Kind() == reflect.Ptr {
		indirectType := structFieldType.Elem()
		indirectVal, unmarshErr := marshaler.unmarshalNonPtr(indirectType, fieldEnvTag, parser)
		if unmarshErr != nil {
			return errors.Wrapf(unmarshErr, "error unmarshaling field %s", fieldName)
		}
		structFieldVal.Set(indirectVal.Addr())
		return nil

	}

	fieldVal, unmarshErr := marshaler.unmarshalNonPtr(structFieldType, fieldEnvTag, parser)
	if unmarshErr != nil {
		return errors.Wrapf(unmarshErr, "error unmarshaling field %s", fieldName)
	}

	structFieldVal.Set(*fieldVal)
	return nil
}
604402
func (t *timeFlag) UnmarshalFlag(value string) error {
	valueInt, err := strconv.Atoi(value)
	if err == nil {
		// We received a number without a unit, assume milliseconds.
		t.setDuration(time.Duration(valueInt) * time.Millisecond)
		return nil
	}

	d, err := time.ParseDuration(value)
	if err != nil {
		return err
	}

	t.setDuration(d)
	return nil
}
1298356
func (z *ID) UnmarshalMsg(bts []byte) (o []byte, err error) {
	{
		var tmp []byte
		tmp, bts, err = msgp.ReadBytesBytes(bts, []byte((*z)))
		(*z) = ID(tmp)
	}
	if err != nil {
		return
	}
	o = bts
	return
}
594616
func (j *GoGoJSONPb) Unmarshal(data []byte, v interface{}) error {
	return unmarshalGoGoJSONPb(data, v)
}
134716
func (bm *BlockMeta) Unmarshal(bs []byte) error {
	return cdc.UnmarshalBinaryBare(bs, bm)
}
1215506
func unmarshal(ext string, buf []byte, out interface{}) error {
	switch ext {
	case ".json":
		return json.Unmarshal(buf, out)
	case ".yaml":
		return yaml.Unmarshal(buf, out)
	}

	return fmt.Errorf("unsupported file extension %v", ext)
}
400950
func Unmarshal(data []byte, v interface{}) error {
	rv := reflect.ValueOf(v)
	if rv.Kind() != reflect.Ptr {
		return fmt.Errorf("not a pointer: %v", v)
	}

	rv = rv.Elem()
	if rv.Kind() != reflect.Struct && rv.Kind() != reflect.Map {
		return fmt.Errorf("not a pointer to a struct/map: %v", v)
	}

	l, err := data2map(data)
	if err != nil {
		return err
	}
	if rv.Kind() == reflect.Map {
		kt := rv.Type().Key()
		vt := rv.Type().Elem()
		if kt.Kind() != reflect.String || vt.Kind() != reflect.String {
			return fmt.Errorf("not a map[string]string")
		}
		for k, v := range l {
			kv := reflect.ValueOf(k).Convert(kt)
			vv := reflect.ValueOf(v).Convert(vt)
			rv.SetMapIndex(kv, vv)
		}
		return nil
	}

	t := rv.Type()
	errs := UnmarshalError{}
	for i := 0; i < t.NumField(); i++ {
		ft := t.Field(i)
		fv := rv.Field(i)

		tag := ft.Tag.Get("ltsv")
		tags := strings.Split(tag, ",")
		key := tags[0]
		if key == "-" {
			continue
		}
		if key == "" {
			key = strings.ToLower(ft.Name)
		}
		s, ok := l[key]
		if !ok {
			continue
		}
		potentiallyNull := s == "-" || s == ""
		if fv.Kind() == reflect.Ptr {
			if fv.IsNil() {
				if potentiallyNull {
					switch fv.Type().Elem().Kind() {
					case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Float32, reflect.Float64:
						continue
					}
				}
				fv.Set(reflect.New(fv.Type().Elem()))
			}
			fv = fv.Elem()
		}
		if !fv.CanSet() {
			continue
		}

		switch fv.Kind() {
		case reflect.String:
			fv.SetString(s)
		case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
			if potentiallyNull {
				continue
			}
			i, err := strconv.ParseInt(s, 10, 64)
			if err != nil || fv.OverflowInt(i) {
				errs[ft.Name] = &UnmarshalTypeError{"number " + s, fv.Type()}
				continue
			}
			fv.SetInt(i)
		case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
			if potentiallyNull {
				continue
			}
			i, err := strconv.ParseUint(s, 10, 64)
			if err != nil || fv.OverflowUint(i) {
				errs[ft.Name] = &UnmarshalTypeError{"number " + s, fv.Type()}
				continue
			}
			fv.SetUint(i)
		case reflect.Float32, reflect.Float64:
			if potentiallyNull {
				continue
			}
			n, err := strconv.ParseFloat(s, fv.Type().Bits())
			if err != nil || fv.OverflowFloat(n) {
				errs[ft.Name] = &UnmarshalTypeError{"number " + s, fv.Type()}
				continue
			}
			fv.SetFloat(n)
		default:
			u := indirect(fv)
			if u == nil {
				errs[ft.Name] = &UnmarshalTypeError{s, fv.Type()}
			} else {
				err := u.UnmarshalText([]byte(s))
				if err != nil {
					errs[ft.Name] = err
				}
			}
		}
	}

	if len(errs) < 1 {
		return nil
	}
	return errs
}
1128732
func (v *Flags) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjsonCce3d1beDecodeGithubComMailgunMailgunGoEvents5(&r, v)
	return r.Error()
}
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
}
1344508
func (z *NestOuter) UnmarshalMsg(bts []byte) (o []byte, err error) {
	var field []byte
	_ = field
	var zb0001 uint32
	zb0001, bts, err = msgp.ReadMapHeaderBytes(bts)
	if err != nil {
		return
	}
	for zb0001 > 0 {
		zb0001--
		field, bts, err = msgp.ReadMapKeyZC(bts)
		if err != nil {
			return
		}
		switch msgp.UnsafeString(field) {
		case "inner":
			if msgp.IsNil(bts) {
				bts, err = msgp.ReadNilBytes(bts)
				if err != nil {
					return
				}
				z.Inner = nil
			} else {
				if z.Inner == nil {
					z.Inner = new(NestInner)
				}
				var zb0002 uint32
				zb0002, bts, err = msgp.ReadMapHeaderBytes(bts)
				if err != nil {
					return
				}
				for zb0002 > 0 {
					zb0002--
					field, bts, err = msgp.ReadMapKeyZC(bts)
					if err != nil {
						return
					}
					switch msgp.UnsafeString(field) {
					case "hello":
						z.Inner.Hello, bts, err = msgp.ReadStringBytes(bts)
						if err != nil {
							return
						}
					default:
						bts, err = msgp.Skip(bts)
						if err != nil {
							return
						}
					}
				}
			}
		default:
			bts, err = msgp.Skip(bts)
			if err != nil {
				return
			}
		}
	}
	o = bts
	return
}
786448
func (z *contype) UnmarshalMsg(bts []byte) (o []byte, err error) {
	{
		var zwht uint8
		zwht, bts, err = msgp.ReadUint8Bytes(bts)
		(*z) = contype(zwht)
	}
	if err != nil {
		return
	}
	o = bts
	return
}
745642
func (z *uint16Slice) UnmarshalMsg(bts []byte) (o []byte, err error) {
	var zgmo uint32
	zgmo, bts, err = msgp.ReadArrayHeaderBytes(bts)
	if err != nil {
		return
	}
	if cap((*z)) >= int(zgmo) {
		(*z) = (*z)[:zgmo]
	} else {
		(*z) = make(uint16Slice, zgmo)
	}
	for zrfe := range *z {
		(*z)[zrfe], bts, err = msgp.ReadUint16Bytes(bts)
		if err != nil {
			return
		}
	}
	o = bts
	return
}
1220571
func (n navigator) Unmarshal(v interface{}) error {
	res, err := n.Get()
	if err != nil {
		return err
	}
	defer res.Body.Close()

	body, err := ioutil.ReadAll(res.Body)
	if err != nil {
		return err
	}

	return json.Unmarshal(body, &v)
}
503451
func (p *Processor) Unmarshal(data []byte) (interface{}, error) {
	if len(data) < 2 {
		return nil, errors.New("protobuf data too short")
	}

	// id
	var id uint16
	if p.littleEndian {
		id = binary.LittleEndian.Uint16(data)
	} else {
		id = binary.BigEndian.Uint16(data)
	}
	if id >= uint16(len(p.msgInfo)) {
		return nil, fmt.Errorf("message id %v not registered", id)
	}

	// msg
	i := p.msgInfo[id]
	if i.msgRawHandler != nil {
		return MsgRaw{id, data[2:]}, nil
	} else {
		msg := reflect.New(i.msgType.Elem()).Interface()
		return msg, proto.UnmarshalMerge(data[2:], msg.(proto.Message))
	}
}
361543
func (d Data) Unmarshal(ptr interface{}) error {
	d.Rewind()
	d.Next()
	err := amqp.UnmarshalUnsafe(d.CPtr(), ptr)
	return err
}
724588
func UnmarshalFromReader(r io.Reader, v Unmarshaler) error {
	data, err := ioutil.ReadAll(r)
	if err != nil {
		return err
	}
	l := jlexer.Lexer{Data: data}
	v.UnmarshalEasyJSON(&l)
	return l.Error()
}