diff --git a/modules/setting/indexer.go b/modules/setting/indexer.go index 304eada607..51b822194a 100644 --- a/modules/setting/indexer.go +++ b/modules/setting/indexer.go @@ -76,9 +76,7 @@ func extensionsFromString(from string) map[string]bool { if ext == "." { extmap[""] = true } else { - if strings.HasPrefix(ext, ".") { - ext = ext[1:] - } + ext = strings.TrimPrefix(ext, ".") if ext != "" { extmap[ext] = true }