提交 51988290 编写于 作者: O openeuler-ci-bot 提交者: Gitee

!8 Fix panic

Merge pull request !8 from wangfengtu/fix_panic
......@@ -24,13 +24,9 @@ func GetDiskUsageStats(path string) (uint64, uint64, error) {
var dirSize, inodeCount uint64
err := filepath.Walk(path, func(path string, info os.FileInfo, err error) error {
fileStat, error := os.Lstat(path)
if error != nil {
if fileStat.Mode()&os.ModeSymlink != 0 {
// Is a symlink; no error should be returned
return nil
}
return error
// Ignore invalid files
if err != nil {
return nil
}
dirSize += uint64(info.Size())
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册