MCPcopy
hub / github.com/valyala/fasthttp / writerFunc

Function writerFunc

stackless/writer.go:122–137  ·  view source on GitHub ↗
(ctx any)

Source from the content-addressed store, hash-verified

120}
121
122func writerFunc(ctx any) {
123 w := ctx.(*writer)
124 switch w.op {
125 case opWrite:
126 w.n, w.err = w.zw.Write(w.p)
127 case opFlush:
128 w.err = w.zw.Flush()
129 case opClose:
130 w.err = w.zw.Close()
131 case opReset:
132 w.zw.Reset(&w.xw)
133 w.err = nil
134 default:
135 panic(fmt.Sprintf("BUG: unexpected op: %d", w.op))
136 }
137}
138
139type xWriter struct {
140 bb *bytebufferpool.ByteBuffer

Callers

nothing calls this directly

Calls 4

WriteMethod · 0.65
FlushMethod · 0.65
CloseMethod · 0.65
ResetMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…