MCPcopy
hub / github.com/bitfield/script / Read

Method Read

script.go:855–860  ·  view source on GitHub ↗

Read reads up to len(b) bytes from the pipe into b. It returns the number of bytes read and any error encountered. At end of file, or on a nil pipe, Read returns 0, [io.EOF].

(b []byte)

Source from the content-addressed store, hash-verified

853// bytes read and any error encountered. At end of file, or on a nil pipe, Read
854// returns 0, [io.EOF].
855func (p *Pipe) Read(b []byte) (int, error) {
856 if p.Error() != nil {
857 return 0, p.Error()
858 }
859 return p.Reader.Read(b)
860}
861
862// SetError sets the error err on the pipe.
863func (p *Pipe) SetError(err error) {

Callers 2

ReadMethod · 0.45

Calls 1

ErrorMethod · 0.95

Tested by 1