MCPcopy
hub / github.com/kevwan/tproxy / readString

Function readString

protocol/mongo.go:212–231  ·  view source on GitHub ↗
(r io.Reader)

Source from the content-addressed store, hash-verified

210}
211
212func readString(r io.Reader) string {
213 var result []byte
214 var b = make([]byte, 1)
215 for {
216
217 _, err := r.Read(b)
218
219 if err != nil {
220 panic(err)
221 }
222
223 if b[0] == '\x00' {
224 break
225 }
226
227 result = append(result, b[0])
228 }
229
230 return string(result)
231}
232
233func readBson2Json(r io.Reader) string {
234 // read len

Callers 1

resolveClientPacketFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected