aboutsummaryrefslogtreecommitdiff
path: root/fs.go
diff options
context:
space:
mode:
Diffstat (limited to 'fs.go')
-rw-r--r--fs.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs.go b/fs.go
index f35f22c..57260d1 100644
--- a/fs.go
+++ b/fs.go
@@ -102,7 +102,7 @@ func ServeFile(ctx *RequestCtx, path string) {
if path == "" || !filepath.IsAbs(path) {
// extend relative path to absolute path
- hasTrailingSlash := len(path) > 0 && (path[len(path)-1] == '/' || path[len(path)-1] == '\\')
+ hasTrailingSlash := path != "" && (path[len(path)-1] == '/' || path[len(path)-1] == '\\')
var err error
path = filepath.FromSlash(path)
@@ -442,7 +442,7 @@ func (fs *FS) normalizeRoot(root string) string {
}
// strip trailing slashes from the root path
- for len(root) > 0 && root[len(root)-1] == os.PathSeparator {
+ for root != "" && root[len(root)-1] == os.PathSeparator {
root = root[:len(root)-1]
}
return root
@@ -468,7 +468,7 @@ func (fs *FS) initRequestHandler() {
}
}
- if len(fs.CompressedFileSuffix) > 0 {
+ if fs.CompressedFileSuffix != "" {
compressedFileSuffixes["gzip"] = fs.CompressedFileSuffix
compressedFileSuffixes["br"] = FSCompressedFileSuffixes["br"]
}