We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 39343ad commit 2d822f4Copy full SHA for 2d822f4
files.go
@@ -31,6 +31,15 @@ func (f *File) Delete() {
31
os.Remove(f.Path)
32
}
33
34
+func newFile(path string) *File {
35
+ f := new(File)
36
+
37
+ f.Path = path
38
+ f.Key = filepath.Base(path)
39
40
+ return f
41
+}
42
43
func scrapeFiles() {
44
if conf.LocalPath == "" {
45
return
@@ -51,15 +60,11 @@ func scrapeFiles() {
51
60
return nil
52
61
53
62
54
- files = append(files, &File{Path: path, Key: filepath.Base(path)})
55
-
56
- return nil
57
- })
58
59
- for i := range files {
- f := files[i]
63
+ f := newFile(path)
64
f.Read()
65
f.Process()
66
f.Delete()
- }
67
68
+ return nil
69
+ })
70
0 commit comments