1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-11 08:12:26 +08:00

refactor: change variable name to

This commit is contained in:
dudaodong
2022-07-18 15:52:51 +08:00
parent 1782b11ec4
commit 44370aef5e
13 changed files with 191 additions and 194 deletions

View File

@@ -116,7 +116,7 @@ func ReadFileByLine(path string) ([]string, error) {
}
defer f.Close()
res := make([]string, 0)
result := make([]string, 0)
buf := bufio.NewReader(f)
for {
@@ -128,10 +128,10 @@ func ReadFileByLine(path string) ([]string, error) {
if err != nil {
continue
}
res = append(res, l)
result = append(result, l)
}
return res, nil
return result, nil
}
// ListFileNames return all file names in the path
@@ -150,14 +150,14 @@ func ListFileNames(path string) ([]string, error) {
return []string{}, nil
}
res := []string{}
result := []string{}
for i := 0; i < sz; i++ {
if !fs[i].IsDir() {
res = append(res, fs[i].Name())
result = append(result, fs[i].Name())
}
}
return res, nil
return result, nil
}
// Zip create zip file, fpath could be a single file or a directory