From be39e6aca8c49f894fedd93f997e76d82cc8386c Mon Sep 17 00:00:00 2001 From: Pierre Dubouilh Date: Sat, 18 Jan 2020 16:33:10 +0100 Subject: [PATCH] case insensitive indexing --- src/gossa.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gossa.go b/src/gossa.go index 48091d2..d84c44a 100755 --- a/src/gossa.go +++ b/src/gossa.go @@ -14,6 +14,7 @@ import ( "net/url" "os" "path/filepath" + "sort" "strconv" "strings" ) @@ -79,6 +80,7 @@ func humanize(bytes int64) string { func replyList(w http.ResponseWriter, fullPath string, path string) { _files, err := ioutil.ReadDir(fullPath) check(err) + sort.Slice(_files, func(i, j int) bool { return strings.ToLower(_files[i].Name()) < strings.ToLower(_files[j].Name()) }) if !strings.HasSuffix(path, "/") { path += "/"