Fix workhorse linter warnings
What does this MR do and why?
Contributes to #438521 (closed)
- Disable false-positive linter finding
- Extract ServeExisting logic into smaller functions
Fixes these linter errors:
$ make golangci | grep -E "^internal/staticpages"
internal/staticpages/servefile.go:32: Function 'ServeExisting' is too long (62 > 60) (funlen)
internal/staticpages/servefile.go:29: internal/staticpages/servefile.go:29: Line contains TODO/BUG/FIXME/NOTE/OPTIMIZE/HACK: "BUG/QUIRK: If a client requests 'foo%2Fb..." (godox)
internal/staticpages/error_pages_test.go:172:34: response body must be closed (bodyclose)
Edited by Vasilii Iakliushin