MCPcopy Create free account
hub / github.com/IBM/sarama / push

Method push

real_decoder.go:367–388  ·  view source on GitHub ↗

stacks

(in pushDecoder)

Source from the content-addressed store, hash-verified

365// stacks
366
367func (rd *realDecoder) push(in pushDecoder) error {
368 in.saveOffset(rd.off)
369
370 var reserve int
371 if dpd, ok := in.(dynamicPushDecoder); ok {
372 if err := dpd.decode(rd); err != nil {
373 return err
374 }
375 } else {
376 reserve = in.reserveLength()
377 if rd.remaining() < reserve {
378 rd.off = len(rd.raw)
379 return ErrInsufficientData
380 }
381 }
382
383 rd.stack = append(rd.stack, in)
384
385 rd.off += reserve
386
387 return nil
388}
389
390func (rd *realDecoder) pop() error {
391 // this is go's ugly pop pattern (the inverse of append)

Callers

nothing calls this directly

Calls 4

remainingMethod · 0.95
saveOffsetMethod · 0.65
decodeMethod · 0.65
reserveLengthMethod · 0.65

Tested by

no test coverage detected