// panics if failed to unmarshal bytes
182891
func loadGenesisDoc(db dbm.DB) (*types.GenesisDoc, error) {
	bytes := db.Get(genesisDocKey)
	if len(bytes) == 0 {
		return nil, errors.New("Genesis doc not found")
	}
	var genDoc *types.GenesisDoc
	err := cdc.UnmarshalJSON(bytes, &genDoc)
	if err != nil {
		cmn.PanicCrisis(fmt.Sprintf("Failed to load genesis doc due to unmarshaling error: %v (bytes: %X)", err, bytes))
	}
	return genDoc, nil
}
1293202
func (p *PID) UnmarshalJSON(data []byte) (err error) {
	p.UPID, err = upid.Parse(string(bytes.Trim(data, `" `)))
	return err
}
148019
func (sj *SerializerJSON) Unmarshal(data []byte, protoData proto.Message) error {
	return jsonpb.Unmarshal(bytes.NewBuffer(data), protoData)
}
1206368
func Panic(v ...interface{}) {
	std.Fprint(std.flags, LEVEL_CRITICAL, 2, fmt.Sprint(v...), nil)
	panic(v)
}
192120
func (bz *HexBytes) UnmarshalJSON(data []byte) error {
	if len(data) < 2 || data[0] != '"' || data[len(data)-1] != '"' {
		return fmt.Errorf("Invalid hex string: %s", data)
	}
	bz2, err := hex.DecodeString(string(data[1 : len(data)-1]))
	if err != nil {
		return err
	}
	*bz = bz2
	return nil
}
674397
func unmarshal(data []byte, contentType string, i interface{}) error {
	msg, isPBMsg := i.(proto.Message)
	if contentType == contentTypePB && isPBMsg {
		if err := unmarshalPB(data, msg); err != nil {
			return fmt.Errorf("decode protobuf: %v", err)
		}
		return nil
	}
	if isPBMsg {
		// only decode into JSON of a protobuf message if the type
		// explicitly implements json.Unmarshaler
		if _, ok := i.(json.Unmarshaler); !ok {
			return fmt.Errorf("cannot decode json payload into protobuf object %T", i)
		}
	}
	if err := json.Unmarshal(data, i); err != nil {
		return fmt.Errorf("decode json: %v", err)
	}
	return nil
}
1108719
func (logs *Logs) Panic(v ...interface{}) {
	s := fmt.Sprint(v...)
	logs.all(s)
	logs.Flush()
	panic(s)
}
110452
func Panic(v ...interface{}) {
	s := fmt.Sprint(v...)
	log.Output(2, s)
	panic(s)
}
647927
func Unmarshal(data []byte, v interface{}) (err error) {
	buf := bytes.NewBuffer(data)
	e := Decoder{r: buf}
	err = e.Decode(v)
	if err == nil && buf.Len() != 0 {
		err = ErrUnusedTrailingBytes{buf.Len()}
	}
	return
}
1297626
func (b *Buffer) UnmarshalJSON(data []byte) error {
	var x string
	if err := json.Unmarshal(data, &x); err != nil {
		return errors.Wrap(err, "failed to unmarshal JSON")
	}
	return b.Base64Decode([]byte(x))
}
17279
func (m *MemSwapBytes) UnmarshalJSON(s []byte) error {
	b := MemBytes(*m)
	return b.UnmarshalJSON(s)
}
416835
func (v *VolumeSnapshot) UnmarshalJSON(data []byte) error {
	tmp := VolumeSnapshotCopy{}
	err := json.Unmarshal(data, &tmp)
	if err != nil {
		return err
	}
	tmp2 := VolumeSnapshot(tmp)
	*v = tmp2
	return nil
}
187642
func UnmarshalConfigUpdateOrPanic(data []byte) *cb.ConfigUpdate {
	result, err := UnmarshalConfigUpdate(data)
	if err != nil {
		panic(err)
	}
	return result
}
1248478
func (pTypeDef *TimestampTest) UnmarshalJSON(b []byte) error {
	var r rawTimestampTest
	err := json.Unmarshal(b, &r)
	if err == nil {
		o := TimestampTest(r)
		*pTypeDef = o
		err = pTypeDef.Validate()
	}
	return err
}
908858
func (v *MediumPayload) UnmarshalJSON(data []byte) error {
	r := jlexer.Lexer{Data: data}
	easyjsonB0500db0DecodeGithubComFrancoispqtGojayBenchmarks(&r, v)
	return r.Error()
}
60171
func Unmarshal(s string, message proto.Message) error {
	data, err := base64.RawURLEncoding.DecodeString(s)
	if err != nil {
		return err
	}
	return proto.Unmarshal(data, message)
}
1149276
func (m *MemBytes) UnmarshalJSON(s []byte) error {
	if len(s) <= 2 || s[0] != '"' || s[len(s)-1] != '"' {
		return fmt.Errorf("invalid size: %q", s)
	}
	val, err := units.RAMInBytes(string(s[1 : len(s)-1]))
	*m = MemBytes(val)
	return err
}