MCPcopy
hub / github.com/docker/docker-agent / Write

Method Write

pkg/tools/builtin/shell/shell.go:103–113  ·  view source on GitHub ↗
(p []byte)

Source from the content-addressed store, hash-verified

101}
102
103func (lw *limitedWriter) Write(p []byte) (n int, err error) {
104 lw.mu.Lock()
105 defer lw.mu.Unlock()
106
107 if remaining := lw.maxSize - lw.written; remaining > 0 {
108 toWrite := min(int64(len(p)), remaining)
109 lw.buf.Write(p[:toWrite]) // bytes.Buffer.Write never errors
110 lw.written += toWrite
111 }
112 return len(p), nil // always report full write
113}
114
115type commandOutput struct {
116 emit tools.ToolOutputEmitter

Calls 2

LockMethod · 0.45
UnlockMethod · 0.45