Report the right size to Top
This commit is contained in:
parent
67e51c9f1b
commit
3db212b3c6
2 changed files with 8 additions and 5 deletions
|
@ -221,7 +221,7 @@ func (i *Intermediate) Spawn(maxLevel int) error {
|
|||
func (i *Intermediate) Collect() error {
|
||||
for s := range i.collect {
|
||||
i.size += s
|
||||
i.refer <- i.size
|
||||
i.refer <- s
|
||||
}
|
||||
close(i.refer)
|
||||
return nil
|
||||
|
@ -330,7 +330,7 @@ func (b *Bottom) Spawn(maxLevel int) error {
|
|||
func (b *Bottom) Collect() error {
|
||||
for s := range b.collect {
|
||||
b.size += s
|
||||
b.refer <- b.size
|
||||
b.refer <- s
|
||||
}
|
||||
close(b.refer)
|
||||
return nil
|
||||
|
|
|
@ -11,10 +11,13 @@ type RealWalker struct {
|
|||
}
|
||||
|
||||
func (r *RealWalker) walkFunc(path string, info os.FileInfo, err error) error {
|
||||
switch mode := info.Mode(); {
|
||||
case mode.IsRegular():
|
||||
r.report <- info.Size()
|
||||
if !info.IsDir() {
|
||||
switch mode := info.Mode(); {
|
||||
case mode.IsRegular():
|
||||
r.report <- info.Size()
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue