MCPcopy
hub / github.com/tinylib/msgp / DecodeMsg

Method DecodeMsg

msgp/setof/generated.go:3472–3497  ·  view source on GitHub ↗

DecodeMsg decodes the message from the reader.

(reader *msgp.Reader)

Source from the content-addressed store, hash-verified

3470
3471// DecodeMsg decodes the message from the reader.
3472func (s *Float64) DecodeMsg(reader *msgp.Reader) error {
3473 if reader.IsNil() {
3474 *s = nil
3475 return reader.Skip()
3476 }
3477 sz, err := reader.ReadArrayHeader()
3478 if err != nil {
3479 return err
3480 }
3481 dst := *s
3482 if dst == nil {
3483 dst = make(Float64, sz)
3484 } else {
3485 clear(dst)
3486 }
3487 for range sz {
3488 var k float64
3489 k, err = reader.ReadFloat64()
3490 if err != nil {
3491 return err
3492 }
3493 dst[float64(k)] = struct{}{}
3494 }
3495 *s = dst
3496 return nil
3497}
3498
3499// UnmarshalMsg decodes the message from the bytes.
3500func (s *Float64) UnmarshalMsg(bytes []byte) ([]byte, error) {

Callers 4

TestFloat64_RoundTripFunction · 0.95
TestFloat64_NilHandlingFunction · 0.95
TestFloat64_EmptySetFunction · 0.95

Calls 4

IsNilMethod · 0.80
SkipMethod · 0.80
ReadArrayHeaderMethod · 0.80
ReadFloat64Method · 0.80

Tested by 4

TestFloat64_RoundTripFunction · 0.76
TestFloat64_NilHandlingFunction · 0.76
TestFloat64_EmptySetFunction · 0.76