Skip to content

Commit

Permalink
feat: disable some lint rules
Browse files Browse the repository at this point in the history
  • Loading branch information
tigerwill90 committed Oct 5, 2024
1 parent 10172d3 commit ed3a282
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions node.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ func linearSearch(keys []byte, s byte) int {
func binarySearch(keys []byte, s byte) int {
low, high := 0, len(keys)-1
for low <= high {
// nolint:gosec
mid := int(uint(low+high) >> 1) // avoid overflow
cmp := compare(keys[mid], s)
if cmp < 0 {
Expand Down
2 changes: 2 additions & 0 deletions options.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ func (o globOptionFunc) applyGlob(r *Router) {
o(r)
}

// nolint:unused
type pathOptionFunc func(*Route)

// nolint:unused
func (o pathOptionFunc) applyPath(r *Route) {
o(r)

Check warning on line 49 in options.go

View check run for this annotation

Codecov / codecov/patch

options.go#L48-L49

Added lines #L48 - L49 were not covered by tests
}
Expand Down
1 change: 1 addition & 0 deletions tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ func (t *Tree) Handle(method, path string, handler HandlerFunc, opts ...PathOpti
return err
}

// nolint:gosec
return t.insert(method, p, catchAllKey, uint32(n), t.newRoute(path, handler, opts...))
}

Expand Down

0 comments on commit ed3a282

Please sign in to comment.