From a5d8c060fb20e025de99ba11a3eb7fc005ab6ecc Mon Sep 17 00:00:00 2001 From: Sakura-Byte <42319937+Sakura-Byte@users.noreply.github.com> Date: Sun, 26 Jan 2025 16:31:39 +0800 Subject: [PATCH] Update alist.go --- backend/alist/alist.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/backend/alist/alist.go b/backend/alist/alist.go index 5a762413e20bd..18fd18962138c 100644 --- a/backend/alist/alist.go +++ b/backend/alist/alist.go @@ -213,9 +213,7 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e } // Ensure url does not end with '/' - if strings.HasSuffix(opt.URL, "/") { - opt.URL = opt.URL[:len(opt.URL)-1] - } + opt.URL = strings.TrimSuffix(opt.URL, "/") // Ensure root starts with '/' if !strings.HasPrefix(root, "/") {