MCPcopy Create free account
hub / github.com/CrowdStrike/csproto / UInt32Values

Method UInt32Values

lazyproto/fielddata.go:183–202  ·  view source on GitHub ↗

UInt32Values converts the lazily-decoded field data into a []uint32. See the [FieldData] docs for more specific details about interpreting lazily-decoded data.

()

Source from the content-addressed store, hash-verified

181//
182// See the [FieldData] docs for more specific details about interpreting lazily-decoded data.
183func (fd *FieldData) UInt32Values() ([]uint32, error) {
184 if fd == nil || len(fd.data) == 0 {
185 return nil, ErrTagNotFound
186 }
187 s, err := sliceValue(fd, csproto.WireTypeVarint, fd.uint32Slice, func(data []byte) (uint32, int, error) {
188 value, n, err := csproto.DecodeVarint(data)
189 if err != nil {
190 return 0, 0, err
191 }
192 if value > math.MaxUint32 {
193 return 0, 0, csproto.ErrValueOverflow
194 }
195 return uint32(value), n, nil
196 })
197 if fd.unsafe {
198 fd.maxCap = max(fd.maxCap, cap(s))
199 fd.uint32Slice = s
200 }
201 return s, err
202}
203
204// Int32Value converts the lazily-decoded field data into an int32.
205//

Callers 3

FuzzNumbersFunction · 0.45
TestUInt32FieldDataFunction · 0.45

Calls 2

DecodeVarintFunction · 0.92
sliceValueFunction · 0.85

Tested by 3

FuzzNumbersFunction · 0.36
TestUInt32FieldDataFunction · 0.36