MCPcopy Index your code
hub / github.com/devspace-sh/devspace / WriteToFile

Function WriteToFile

pkg/util/fsutil/filesystem.go:28–35  ·  view source on GitHub ↗

WriteToFile writes data to a file

(data []byte, filePath string)

Source from the content-addressed store, hash-verified

26
27// WriteToFile writes data to a file
28func WriteToFile(data []byte, filePath string) error {
29 err := os.MkdirAll(filepath.Dir(filePath), 0755)
30 if err != nil {
31 return err
32 }
33
34 return os.WriteFile(filePath, data, 0666)
35}
36
37// ReadFile reads a file with a given limit
38func ReadFile(path string, limit int64) ([]byte, error) {

Callers 15

TestWatcherFunction · 0.92
TestGetAllAuthConfigsFunction · 0.92
TestGetAuthConfigFunction · 0.92
TestLoginFunction · 0.92
TestResolverFunction · 0.92
testLoadFunction · 0.92
testExistsFunction · 0.92
testLoadFunction · 0.92
testSetDevSpaceRootFunction · 0.92
testGetProfilesFunction · 0.92
TestHashDirectoryFunction · 0.92

Calls

no outgoing calls

Tested by 14

TestWatcherFunction · 0.74
TestGetAllAuthConfigsFunction · 0.74
TestGetAuthConfigFunction · 0.74
TestLoginFunction · 0.74
TestResolverFunction · 0.74
testLoadFunction · 0.74
testExistsFunction · 0.74
testLoadFunction · 0.74
testSetDevSpaceRootFunction · 0.74
testGetProfilesFunction · 0.74
TestHashDirectoryFunction · 0.74