MCPcopy Create free account
hub / github.com/tailscale/tailscale / writeString

Function writeString

cmd/nardump/nardump/nardump.go:161–171  ·  view source on GitHub ↗
(w io.Writer, s string)

Source from the content-addressed store, hash-verified

159}
160
161func writeString(w io.Writer, s string) error {
162 var buf [8]byte
163 binary.LittleEndian.PutUint64(buf[:], uint64(len(s)))
164 if _, err := w.Write(buf[:]); err != nil {
165 return err
166 }
167 if _, err := io.WriteString(w, s); err != nil {
168 return err
169 }
170 return writePad(w, len(s))
171}
172
173func writeBytes(w io.Writer, b []byte) error {
174 var buf [8]byte

Callers 1

strMethod · 0.70

Calls 3

writePadFunction · 0.85
WriteStringMethod · 0.80
WriteMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…