MCPcopy
hub / github.com/u-root/u-root / encodeOne

Function encodeOne

xcmds/archive/encode.go:16–29  ·  view source on GitHub ↗
(out io.Writer, f *file)

Source from the content-addressed store, hash-verified

14)
15
16func encodeOne(out io.Writer, f *file) error {
17 if f.Size == 0 || !f.Mode.IsRegular() {
18 return nil
19 }
20
21 in, err := os.Open(f.Name)
22 if err != nil {
23 return err
24 }
25 defer in.Close()
26 amt, err := io.Copy(out, in)
27 debug("%s: wrote %d bytes", f.Name, amt)
28 return err
29}
30
31func encode(out io.Writer, dirs ...string) error {
32 var vtoc []*file

Callers 1

encodeFunction · 0.85

Calls 3

CopyMethod · 0.80
CloseMethod · 0.65
debugFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…