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

Function WriteFile

tests/src/integration/common/utils.go:77–89  ·  view source on GitHub ↗
(filePath string, lines []string)

Source from the content-addressed store, hash-verified

75}
76
77func WriteFile(filePath string, lines []string) {
78 var file, err = os.OpenFile(filePath, os.O_RDWR, 0644)
79 checkError(err)
80 defer file.Close()
81
82 for _, each := range lines {
83 _, err = file.WriteString(each + "\n")
84 checkError(err)
85 }
86
87 err = file.Sync()
88 checkError(err)
89}
90
91func DeleteFile(filePath string) {
92 var err = os.Remove(filePath)

Callers 2

TestDefaultNamespaceFunction · 0.92

Calls 1

checkErrorFunction · 0.85

Tested by 2

TestDefaultNamespaceFunction · 0.74