small fixes and dependency updates

This commit is contained in:
ston1th 2023-08-25 02:06:53 +02:00
commit 96405e2521
238 changed files with 3599 additions and 3467 deletions

View file

@ -4,14 +4,14 @@ package srv
import (
"bytes"
"cmp"
"encoding/xml"
"html/template"
"net/http"
"slices"
"strings"
"cachefs/pkg/fs"
"golang.org/x/exp/slices"
)
type statusInterceptor struct {
@ -54,7 +54,7 @@ type dir struct {
type dirs []dir
func (dirs) Less(i, j dir) bool { return i.Name < j.Name }
func (dirs) Comp(a, b dir) int { return cmp.Compare(a.Name, b.Name) }
type file struct {
Name template.HTML
@ -70,7 +70,7 @@ type file struct {
type files []file
func (files) Less(i, j file) bool { return i.Name < j.Name }
func (files) Comp(a, b file) int { return cmp.Compare(a.Name, b.Name) }
type responseInterceptor struct {
buf bytes.Buffer
@ -145,8 +145,8 @@ func (r *responseInterceptor) GetPaths(path string, filesystem *fs.FS, relative
})
}
}
slices.SortFunc(dc.Dirs, dc.Dirs.Less)
slices.SortFunc(dc.Files, dc.Files.Less)
slices.SortFunc(dc.Dirs, dc.Dirs.Comp)
slices.SortFunc(dc.Files, dc.Files.Comp)
return
}

View file

@ -4,12 +4,12 @@ package srv
import (
"net/http"
"slices"
"strings"
"cachefs/pkg/fs"
"github.com/go-logr/logr"
"golang.org/x/exp/slices"
"golang.org/x/net/webdav"
)