ignore case when sorting by extension

This commit is contained in:
Lilian Jónsdóttir 2024-07-27 21:05:12 -07:00
parent 7fade0ce4c
commit 0fb1cfa22a

View file

@ -72,14 +72,14 @@ func SortByPathReverse(a, b File) int {
} }
func SortByExtension(a, b File) int { func SortByExtension(a, b File) int {
aext := filepath.Ext(a.Name()) aext := strings.ToLower(filepath.Ext(a.Name()))
bext := filepath.Ext(b.Name()) bext := strings.ToLower(filepath.Ext(b.Name()))
return cmp.Compare(aext, bext) return cmp.Compare(aext, bext)
} }
func SortByExtensionReverse(a, b File) int { func SortByExtensionReverse(a, b File) int {
aext := filepath.Ext(a.Name()) aext := strings.ToLower(filepath.Ext(a.Name()))
bext := filepath.Ext(b.Name()) bext := strings.ToLower(filepath.Ext(b.Name()))
return cmp.Compare(bext, aext) return cmp.Compare(bext, aext)
} }