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 132ec66 commit aa3515cCopy full SHA for aa3515c
fs.go
@@ -18,20 +18,25 @@ func RemoveAll(f string) error {
18
19
entrysLen := len(entrys)
20
21
- chs := make(chan interface{}, entrysLen)
+ chs := make(chan struct{}, entrysLen)
22
errChan := make(chan error)
23
24
for _, entry := range entrys {
25
go func(entry os.DirEntry) {
26
p := path.Join(f, entry.Name())
27
if entry.IsDir() {
28
- nestedErr := RemoveAll(p)
29
- if nestedErr != nil {
30
- errChan <- nestedErr
+ err := RemoveAll(p)
+ if err != nil {
+ errChan <- err
31
}
32
return
33
34
- os.Remove(p)
+ err := os.Remove(p)
35
36
37
+ return
38
+ }
39
+ chs <- struct{}{}
40
}(entry)
41
42
0 commit comments