refactor: add more go linters (#970)

This commit is contained in:
Oleg Lobanov authored and GitHub committed 2020-06-01 01:12:36 +02:00
1 parent 54d92a2708
commit 700f32718e
56 files changed
+436 -221

No files matched your search

+1 -1
View File
@@ -46,7 +46,7 @@ func ifPathWithName(r *http.Request) string {
pathElements := strings.Split(r.URL.Path, "/")
// prevent maliciously constructed parameters like `/api/public/dl/XZzCDnK2_not_exists_hash_name`
// len(pathElements) will be 1, and golang will panic `runtime error: index out of range`
if len(pathElements) < 2 {
if len(pathElements) < 2 { //nolint: mnd
return r.URL.Path
}
id := pathElements[len(pathElements)-2]