From 0fb1cfa22aead36591d9bfee8116028463e1f260 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lilian=20J=C3=B3nsd=C3=B3ttir?= Date: Sat, 27 Jul 2024 21:05:12 -0700 Subject: [PATCH] ignore case when sorting by extension --- internal/files/files.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/files/files.go b/internal/files/files.go index 48d12ec..2505e1e 100644 --- a/internal/files/files.go +++ b/internal/files/files.go @@ -72,14 +72,14 @@ func SortByPathReverse(a, b File) int { } func SortByExtension(a, b File) int { - aext := filepath.Ext(a.Name()) - bext := filepath.Ext(b.Name()) + aext := strings.ToLower(filepath.Ext(a.Name())) + bext := strings.ToLower(filepath.Ext(b.Name())) return cmp.Compare(aext, bext) } func SortByExtensionReverse(a, b File) int { - aext := filepath.Ext(a.Name()) - bext := filepath.Ext(b.Name()) + aext := strings.ToLower(filepath.Ext(a.Name())) + bext := strings.ToLower(filepath.Ext(b.Name())) return cmp.Compare(bext, aext) }