MCPcopy
hub / github.com/IceWhaleTech/CasaOS / ReadFullFile

Function ReadFullFile

pkg/utils/file/file.go:193–204  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

191}
192
193func ReadFullFile(path string) []byte {
194 file, err := os.Open(path)
195 if err != nil {
196 return []byte("")
197 }
198 defer file.Close()
199 content, err := ioutil.ReadAll(file)
200 if err != nil {
201 return []byte("")
202 }
203 return content
204}
205
206// File copies a single file from src to dst
207func CopyFile(src, dst, style string) error {

Callers 1

InitInfoFunction · 0.92

Calls 1

CloseMethod · 0.80

Tested by

no test coverage detected