From 3481ad22cb8ac38b05726bf9441dae419229c17c Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Tue, 10 Feb 2026 17:56:04 -0800 Subject: [PATCH] go vet --- .../empty_folder_cleanup/empty_folder_cleaner.go | 4 ++-- .../empty_folder_cleaner_test.go | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/weed/filer/empty_folder_cleanup/empty_folder_cleaner.go b/weed/filer/empty_folder_cleanup/empty_folder_cleaner.go index f011cbf88..a681d39ae 100644 --- a/weed/filer/empty_folder_cleanup/empty_folder_cleaner.go +++ b/weed/filer/empty_folder_cleanup/empty_folder_cleaner.go @@ -400,7 +400,7 @@ func autoRemoveEmptyFoldersEnabled(attrs map[string][]byte) (bool, string) { return true, "" } - value, found := attrs[s3_constants.ExtAutoRemoveEmptyFolders] + value, found := attrs[s3_constants.ExtAllowEmptyFolders] if !found { return true, "" } @@ -410,7 +410,7 @@ func autoRemoveEmptyFoldersEnabled(attrs map[string][]byte) (bool, string) { return true, "" } - return !strings.EqualFold(text, "false"), text + return !strings.EqualFold(text, "true"), text } // isUnderPath checks if child is under parent path diff --git a/weed/filer/empty_folder_cleanup/empty_folder_cleaner_test.go b/weed/filer/empty_folder_cleanup/empty_folder_cleaner_test.go index 2d1a62933..4fdd0687a 100644 --- a/weed/filer/empty_folder_cleanup/empty_folder_cleaner_test.go +++ b/weed/filer/empty_folder_cleanup/empty_folder_cleaner_test.go @@ -160,20 +160,20 @@ func Test_autoRemoveEmptyFoldersEnabled(t *testing.T) { attrValue: "", }, { - name: "false disables cleanup", + name: "allow-empty disables cleanup", attrs: map[string][]byte{ - s3_constants.ExtAutoRemoveEmptyFolders: []byte("false"), + s3_constants.ExtAllowEmptyFolders: []byte("true"), }, enabled: false, - attrValue: "false", + attrValue: "true", }, { - name: "true enables cleanup", + name: "explicit false keeps cleanup enabled", attrs: map[string][]byte{ - s3_constants.ExtAutoRemoveEmptyFolders: []byte("true"), + s3_constants.ExtAllowEmptyFolders: []byte("false"), }, enabled: true, - attrValue: "true", + attrValue: "false", }, } @@ -750,7 +750,7 @@ func TestEmptyFolderCleaner_executeCleanup_bucketPolicyDisabledSkips(t *testing. }, attrsFn: func(path util.FullPath) (map[string][]byte, error) { if string(path) == "/buckets/test" { - return map[string][]byte{s3_constants.ExtAutoRemoveEmptyFolders: []byte("false")}, nil + return map[string][]byte{s3_constants.ExtAllowEmptyFolders: []byte("true")}, nil } return nil, nil },