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

Function writeBytes

cmd/nardump/nardump/nardump.go:173–183  ·  view source on GitHub ↗
(w io.Writer, b []byte)

Source from the content-addressed store, hash-verified

171}
172
173func writeBytes(w io.Writer, b []byte) error {
174 var buf [8]byte
175 binary.LittleEndian.PutUint64(buf[:], uint64(len(b)))
176 if _, err := w.Write(buf[:]); err != nil {
177 return err
178 }
179 if _, err := w.Write(b); err != nil {
180 return err
181 }
182 return writePad(w, len(b))
183}
184
185func writePad(w io.Writer, n int) error {
186 pad := n % 8

Callers 1

writeRegularMethod · 0.85

Calls 2

writePadFunction · 0.85
WriteMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…