mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-29 22:29:56 +02:00
all: Fix typos in function names and comments
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
12dc9a6e4a
commit
9009c8cdca
@@ -92,7 +92,7 @@ func NewLanguageFs(langs map[string]int, fs afero.Fs) (afero.Fs, error) {
|
||||
fim := fi.(FileMetaInfo)
|
||||
langs := translations[fim.Meta().TranslationBaseNameWithExt]
|
||||
if len(langs) > 0 {
|
||||
fim.Meta().Translations = sortAndremoveStringDuplicates(langs)
|
||||
fim.Meta().Translations = sortAndRemoveStringDuplicates(langs)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -328,7 +328,7 @@ func printFs(fs afero.Fs, path string, w io.Writer) {
|
||||
})
|
||||
}
|
||||
|
||||
func sortAndremoveStringDuplicates(s []string) []string {
|
||||
func sortAndRemoveStringDuplicates(s []string) []string {
|
||||
ss := sort.StringSlice(s)
|
||||
ss.Sort()
|
||||
i := 0
|
||||
|
@@ -175,7 +175,7 @@ func MakeReadableAndRemoveAllModulePkgDir(fs afero.Fs, dir string) (int, error)
|
||||
}
|
||||
|
||||
// IsOsFs returns whether fs is an OsFs or if it fs wraps an OsFs.
|
||||
// TODO(bep) make this nore robust.
|
||||
// TODO(bep) make this more robust.
|
||||
func IsOsFs(fs afero.Fs) bool {
|
||||
var isOsFs bool
|
||||
WalkFilesystems(fs, func(fs afero.Fs) bool {
|
||||
|
@@ -59,11 +59,11 @@ func TestFilenameFilter(t *testing.T) {
|
||||
c.Assert(includeOnlyFilter.Match("ab.jpg", false), qt.Equals, true)
|
||||
c.Assert(includeOnlyFilter.Match("ab.gif", false), qt.Equals, false)
|
||||
|
||||
exlcudeOnlyFilter, err := NewFilenameFilter(nil, []string{"**.json", "**.jpg"})
|
||||
excludeOnlyFilter, err := NewFilenameFilter(nil, []string{"**.json", "**.jpg"})
|
||||
c.Assert(err, qt.IsNil)
|
||||
c.Assert(exlcudeOnlyFilter.Match("ab.json", false), qt.Equals, false)
|
||||
c.Assert(exlcudeOnlyFilter.Match("ab.jpg", false), qt.Equals, false)
|
||||
c.Assert(exlcudeOnlyFilter.Match("ab.gif", false), qt.Equals, true)
|
||||
c.Assert(excludeOnlyFilter.Match("ab.json", false), qt.Equals, false)
|
||||
c.Assert(excludeOnlyFilter.Match("ab.jpg", false), qt.Equals, false)
|
||||
c.Assert(excludeOnlyFilter.Match("ab.gif", false), qt.Equals, true)
|
||||
|
||||
var nilFilter *FilenameFilter
|
||||
c.Assert(nilFilter.Match("ab.gif", false), qt.Equals, true)
|
||||
|
Reference in New Issue
Block a user