MCPcopy
hub / github.com/MetaCubeX/mihomo / closeWrite

Function closeWrite

common/net/sing.go:60–65  ·  view source on GitHub ↗
(writer io.Closer)

Source from the content-addressed store, hash-verified

58var Pipe = deadline.Pipe
59
60func closeWrite(writer io.Closer) error {
61 if c, ok := common.Cast[network.WriteCloser](writer); ok {
62 return c.CloseWrite()
63 }
64 return writer.Close()
65}
66
67// Relay copies between left and right bidirectionally.
68// like [bufio.CopyConn] but remove unneeded [context.Context] handle and the cost of [task.Group]

Callers 1

RelayFunction · 0.85

Calls 2

CloseMethod · 0.65
CloseWriteMethod · 0.45

Tested by

no test coverage detected