MCPcopy Index your code
hub / github.com/coder/coder / NewLimitWriter

Function NewLimitWriter

coderd/util/xio/limitwriter.go:18–28  ·  view source on GitHub ↗
(w io.Writer, n int64)

Source from the content-addressed store, hash-verified

16}
17
18func NewLimitWriter(w io.Writer, n int64) *LimitWriter {
19 // If anyone tries this, just make a 0 writer.
20 if n < 0 {
21 n = 0
22 }
23 return &LimitWriter{
24 Limit: n,
25 N: 0,
26 W: w,
27 }
28}
29
30func (l *LimitWriter) Write(p []byte) (int, error) {
31 if l.N >= l.Limit {

Callers 3

TestLimitWriterFunction · 0.92
TarFunction · 0.92

Calls

no outgoing calls

Tested by 1

TestLimitWriterFunction · 0.74