MCPcopy Index your code
hub / github.com/tinylib/msgp / DecodeMsg

Method DecodeMsg

msgp/setof/generated.go:1348–1373  ·  view source on GitHub ↗

DecodeMsg decodes the message from the reader.

(reader *msgp.Reader)

Source from the content-addressed store, hash-verified

1346
1347// DecodeMsg decodes the message from the reader.
1348func (s *Int8Sorted) DecodeMsg(reader *msgp.Reader) error {
1349 if reader.IsNil() {
1350 *s = nil
1351 return reader.Skip()
1352 }
1353 sz, err := reader.ReadArrayHeader()
1354 if err != nil {
1355 return err
1356 }
1357 dst := *s
1358 if dst == nil {
1359 dst = make(Int8Sorted, sz)
1360 } else {
1361 clear(dst)
1362 }
1363 for range sz {
1364 var k int8
1365 k, err = reader.ReadInt8()
1366 if err != nil {
1367 return err
1368 }
1369 dst[int8(k)] = struct{}{}
1370 }
1371 *s = dst
1372 return nil
1373}
1374
1375// UnmarshalMsg decodes the message from the bytes.
1376func (s *Int8Sorted) UnmarshalMsg(bytes []byte) ([]byte, error) {

Callers 4

TestInt8Sorted_RoundTripFunction · 0.95
TestInt8Sorted_EmptySetFunction · 0.95

Calls 4

IsNilMethod · 0.80
SkipMethod · 0.80
ReadArrayHeaderMethod · 0.80
ReadInt8Method · 0.80

Tested by 4

TestInt8Sorted_RoundTripFunction · 0.76
TestInt8Sorted_EmptySetFunction · 0.76