MCPcopy
hub / github.com/dropbox/godropbox / parseValue

Method parseValue

database/binlog/string_fields.go:88–108  ·  view source on GitHub ↗
(data []byte)

Source from the content-addressed store, hash-verified

86}
87
88func (d *packedLengthFieldDescriptor) parseValue(data []byte) (
89 value interface{},
90 remaining []byte,
91 err error) {
92
93 sizeBytes, remaining, err := readSlice(data, d.packedLength)
94 if err != nil {
95 return nil, nil, err
96 }
97
98 size := bytesToLEUint(sizeBytes)
99
100 // NOTE: slice and long blob don't work well together. In particular,
101 // the largest slice is 2GB (because the len intrinsic returns an int),
102 // while the largest long blob is 4GB.
103 if size > uint64(math.MaxInt32) {
104 return nil, nil, errors.Newf("Blob too large: %d", size)
105 }
106
107 return readSlice(remaining, int(size))
108}
109
110//
111// stringFieldDescriptor -----------------------------------------------------

Callers 2

ParseValueMethod · 0.80
ParseValueMethod · 0.80

Calls 3

NewfFunction · 0.92
readSliceFunction · 0.85
bytesToLEUintFunction · 0.85

Tested by

no test coverage detected