From d00fb2163a1fbd3b0566be56a39626204faa3456 Mon Sep 17 00:00:00 2001 From: John Bro <42930107+john1298308460@users.noreply.github.com> Date: Thu, 27 Jun 2024 14:00:53 +0800 Subject: [PATCH] =?UTF-8?q?fit:=20=E6=96=87=E4=BB=B6=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=A4=A7=E5=B0=8F=E5=80=BC=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=20(#5583)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/utils/files/fileinfo.go | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/backend/utils/files/fileinfo.go b/backend/utils/files/fileinfo.go index 102450d3f..224e95296 100644 --- a/backend/utils/files/fileinfo.go +++ b/backend/utils/files/fileinfo.go @@ -64,20 +64,6 @@ type FileSearchInfo struct { fs.FileInfo } -func getDirSize(fs afero.Fs, path string) (int64, error) { - var size int64 - err := afero.Walk(fs, path, func(p string, info os.FileInfo, err error) error { - if err != nil { - return err - } - if !info.IsDir() { - size += info.Size() - } - return nil - }) - return size, err -} - func NewFileInfo(op FileOption) (*FileInfo, error) { var appFs = afero.NewOsFs() @@ -115,11 +101,6 @@ func NewFileInfo(op FileOption) (*FileInfo, error) { } if op.Expand { if file.IsDir { - size, err := getDirSize(appFs, op.Path) - if err != nil { - return nil, err - } - file.Size = size if err := file.listChildren(op); err != nil { return nil, err }