MCPcopy Index your code
hub / github.com/docker/cli / Write

Method Write

cli/connhelper/commandconn/commandconn.go:182–194  ·  view source on GitHub ↗
(p []byte)

Source from the content-addressed store, hash-verified

180}
181
182func (c *commandConn) Write(p []byte) (int, error) {
183 n, err := c.stdin.Write(p)
184 // check after the call to Write, since
185 // it is blocking, and while waiting on it
186 // Close might get called
187 if c.closing.Load() {
188 // If we're currently closing the connection
189 // we don't want to call onEOF
190 return n, err
191 }
192
193 return n, c.handleEOF(err)
194}
195
196// CloseRead allows commandConn to implement halfCloser
197func (c *commandConn) CloseRead() error {

Callers 6

TestCloseRunningCommandFunction · 0.45
TestCloseWhileWritingFunction · 0.45
WriteMethod · 0.45
TestImportZipFunction · 0.45
TestImportZipInvalidFunction · 0.45
SaveToWriterMethod · 0.45

Calls 1

handleEOFMethod · 0.95

Tested by 4

TestCloseRunningCommandFunction · 0.36
TestCloseWhileWritingFunction · 0.36
TestImportZipFunction · 0.36
TestImportZipInvalidFunction · 0.36