MCPcopy Create free account
hub / github.com/containerd/nerdctl / Read

Method Read

pkg/taskutil/taskutil.go:291–305  ·  view source on GitHub ↗
(p []byte)

Source from the content-addressed store, hash-verified

289}
290
291func (s *StdinCloser) Read(p []byte) (int, error) {
292 s.mu.Lock()
293 defer s.mu.Unlock()
294 if s.closed {
295 return 0, syscall.EBADF
296 }
297 n, err := s.Stdin.Read(p)
298 if err != nil {
299 if s.Closer != nil {
300 s.Closer()
301 s.closed = true
302 }
303 }
304 return n, err
305}
306
307// Close implements Closer
308func (s *StdinCloser) Close() error {

Callers

nothing calls this directly

Calls 2

LockMethod · 0.65
ReadMethod · 0.65

Tested by

no test coverage detected