MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / Write

Method Write

agent/utils/cmd/cmdx.go:54–68  ·  view source on GitHub ↗
(p []byte)

Source from the content-addressed store, hash-verified

52}
53
54func (b *lockedBuffer) Write(p []byte) (int, error) {
55 b.mu.Lock()
56 defer b.mu.Unlock()
57 if b.limit > 0 && b.buf.Len() >= b.limit {
58 b.truncated += len(p)
59 return len(p), nil
60 }
61 if b.limit > 0 && b.buf.Len()+len(p) > b.limit {
62 keep := b.limit - b.buf.Len()
63 _, _ = b.buf.Write(p[:keep])
64 b.truncated += len(p) - keep
65 return len(p), nil
66 }
67 return b.buf.Write(p)
68}
69
70func (b *lockedBuffer) String() string {
71 b.mu.Lock()

Callers 4

sendEmailWithClientFunction · 0.45
WriteMethod · 0.45
GetRemoteTimeFunction · 0.45
getMD5Function · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected