MCPcopy Create free account
hub / github.com/corunb/Split_tools / ReadFile

Function ReadFile

cmd/ReadandWrite.go:11–25  ·  view source on GitHub ↗

ReadFile 读取文件列表返回数组

(File string)

Source from the content-addressed store, hash-verified

9
10// ReadFile 读取文件列表返回数组
11func ReadFile(File string) string {
12 f, err := os.Open(File)
13 if err != nil {
14 fmt.Println("read file fail", err)
15 return ""
16 }
17
18 fd, err := ioutil.ReadAll(f)
19 if err != nil {
20 fmt.Println("read to fd fail", err)
21 return ""
22 }
23
24 return string(fd)
25}
26
27// Write 写文件
28func Write(output string, number int) {

Callers 3

RunFunction · 0.85
PartitionFunction · 0.85
EnBase64Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected