MCPcopy Create free account
hub / github.com/AdRoll/baker / Copy

Function Copy

testutil/dir.go:51–67  ·  view source on GitHub ↗
(srcFile, dstFile string)

Source from the content-addressed store, hash-verified

49}
50
51func Copy(srcFile, dstFile string) error {
52 out, err := os.Create(dstFile)
53 if err != nil {
54 return err
55 }
56
57 defer out.Close()
58
59 in, err := os.Open(srcFile)
60 if err != nil {
61 return err
62 }
63 defer in.Close()
64
65 _, err = io.Copy(out, in)
66 return err
67}
68
69func Exists(filePath string) bool {
70 if _, err := os.Stat(filePath); os.IsNotExist(err) {

Callers 1

CopyDirectoryFunction · 0.85

Calls 2

CloseMethod · 0.65
CopyMethod · 0.65

Tested by

no test coverage detected