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

Function prefixLines

codersdk/client.go:208–216  ·  view source on GitHub ↗
(prefix, s []byte)

Source from the content-addressed store, hash-verified

206}
207
208func prefixLines(prefix, s []byte) []byte {
209 ss := bytes.NewBuffer(make([]byte, 0, len(s)*2))
210 for _, line := range bytes.Split(s, []byte("\n")) {
211 _, _ = ss.Write(prefix)
212 _, _ = ss.Write(line)
213 _ = ss.WriteByte('\n')
214 }
215 return ss.Bytes()
216}
217
218// Request performs a HTTP request with the body provided. The caller is
219// responsible for closing the response body.

Callers 1

Calls 2

WriteMethod · 0.65
BytesMethod · 0.45

Tested by

no test coverage detected