MCPcopy Create free account
hub / github.com/apache/openwhisk-cli / ReadFile

Function ReadFile

tests/src/integration/common/utils.go:59–75  ·  view source on GitHub ↗
(filePath string)

Source from the content-addressed store, hash-verified

57}
58
59func ReadFile(filePath string) string {
60 var file, err = os.OpenFile(filePath, os.O_RDWR, 0644)
61 checkError(err)
62 defer file.Close()
63
64 var text = make([]byte, 1024)
65 for {
66 n, err := file.Read(text)
67 if err != io.EOF {
68 checkError(err)
69 }
70 if n == 0 {
71 break
72 }
73 }
74 return string(text)
75}
76
77func WriteFile(filePath string, lines []string) {
78 var file, err = os.OpenFile(filePath, os.O_RDWR, 0644)

Callers 2

TestSetAuthFunction · 0.92
TestSetMultipleValuesFunction · 0.92

Calls 1

checkErrorFunction · 0.85

Tested by 2

TestSetAuthFunction · 0.74
TestSetMultipleValuesFunction · 0.74