summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/spf13/afero/util.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2023-01-28 22:57:53 +0100
committerGitHub <noreply@github.com>2023-01-28 22:57:53 +0100
commit880586bac42817ffcfea5d9f746f503fa29915b8 (patch)
treea89374cba6f88975f12316ec8d1b8aa1d4c6ba79 /vendor/github.com/spf13/afero/util.go
parenteac2a8c8dc831f946970d327e2a80b26b0684255 (diff)
downloadmatterbridge-msglm-880586bac42817ffcfea5d9f746f503fa29915b8.tar.gz
matterbridge-msglm-880586bac42817ffcfea5d9f746f503fa29915b8.tar.bz2
matterbridge-msglm-880586bac42817ffcfea5d9f746f503fa29915b8.zip
Update dependencies (#1951)
Diffstat (limited to 'vendor/github.com/spf13/afero/util.go')
-rw-r--r--vendor/github.com/spf13/afero/util.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/vendor/github.com/spf13/afero/util.go b/vendor/github.com/spf13/afero/util.go
index 4f253f48..cb7de23f 100644
--- a/vendor/github.com/spf13/afero/util.go
+++ b/vendor/github.com/spf13/afero/util.go
@@ -25,6 +25,7 @@ import (
"strings"
"unicode"
+ "golang.org/x/text/runes"
"golang.org/x/text/transform"
"golang.org/x/text/unicode/norm"
)
@@ -158,16 +159,12 @@ func UnicodeSanitize(s string) string {
// Transform characters with accents into plain forms.
func NeuterAccents(s string) string {
- t := transform.Chain(norm.NFD, transform.RemoveFunc(isMn), norm.NFC)
+ t := transform.Chain(norm.NFD, runes.Remove(runes.In(unicode.Mn)), norm.NFC)
result, _, _ := transform.String(t, string(s))
return result
}
-func isMn(r rune) bool {
- return unicode.Is(unicode.Mn, r) // Mn: nonspacing marks
-}
-
func (a Afero) FileContainsBytes(filename string, subslice []byte) (bool, error) {
return FileContainsBytes(a.Fs, filename, subslice)
}
@@ -299,6 +296,9 @@ func IsEmpty(fs Fs, path string) (bool, error) {
}
defer f.Close()
list, err := f.Readdir(-1)
+ if err != nil {
+ return false, err
+ }
return len(list) == 0, nil
}
return fi.Size() == 0, nil