MCPcopy Create free account
hub / github.com/imroc/req / Read

Method Read

transfer.go:760–767  ·  view source on GitHub ↗
(p []byte)

Source from the content-addressed store, hash-verified

758}
759
760func (b *body) Read(p []byte) (n int, err error) {
761 b.mu.Lock()
762 defer b.mu.Unlock()
763 if b.closed {
764 return 0, http.ErrBodyReadAfterClose
765 }
766 return b.readLocked(p)
767}
768
769// Must hold b.mu.
770func (b *body) readLocked(p []byte) (n int, err error) {

Callers 2

probeRequestBodyMethod · 0.45
readLockedMethod · 0.45

Calls 3

readLockedMethod · 0.95
LockMethod · 0.80
UnlockMethod · 0.80

Tested by

no test coverage detected