MCPcopy Create free account
hub / github.com/coder/envbox / copyCertFile

Function copyCertFile

dockerutil/registry.go:73–92  ·  view source on GitHub ↗
(fs xunix.FS, src, dst string)

Source from the content-addressed store, hash-verified

71}
72
73func copyCertFile(fs xunix.FS, src, dst string) error {
74 srcFile, err := fs.Open(src)
75 if err != nil {
76 return xerrors.Errorf("open source file: %w", err)
77 }
78 defer srcFile.Close()
79
80 dstFile, err := fs.Create(dst)
81 if err != nil {
82 return xerrors.Errorf("create destination file: %w", err)
83 }
84 defer dstFile.Close()
85
86 _, err = io.Copy(dstFile, srcFile)
87 if err != nil {
88 return xerrors.Errorf("copy file contents: %w", err)
89 }
90
91 return nil
92}

Callers 1

WriteCertsForRegistryFunction · 0.85

Calls 2

ErrorfMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected