chore: update linter
This commit is contained in:
parent
1034646ae2
commit
88a2020817
57 changed files with 139 additions and 218 deletions
|
@ -1,6 +1,7 @@
|
|||
package types
|
||||
|
||||
import (
|
||||
"slices"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
@ -34,10 +35,7 @@ func NewHTTPCodeRanges(strBlocks []string) (HTTPCodeRanges, error) {
|
|||
|
||||
// Contains tests whether the passed status code is within one of its HTTP code ranges.
|
||||
func (h HTTPCodeRanges) Contains(statusCode int) bool {
|
||||
for _, block := range h {
|
||||
if statusCode >= block[0] && statusCode <= block[1] {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
return slices.ContainsFunc(h, func(block [2]int) bool {
|
||||
return statusCode >= block[0] && statusCode <= block[1]
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue