Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ jobs:
go build -race

- name: golangci-lint
uses: golangci/golangci-lint-action@v4
uses: golangci/golangci-lint-action@v9
with:
version: latest
version: v2.12.2
59 changes: 33 additions & 26 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,40 @@
version: "2"
linters:
default: none
enable:
- revive
- govet
- unconvert
- megacheck
- gas
- gocyclo
- dupl
- misspell
- unparam
- unused
- typecheck
- ineffassign
- stylecheck
- gochecknoinits
- exportloopref
- gocritic
- gocyclo
- gosec
- govet
- ineffassign
- misspell
- nakedret
- gosimple
- prealloc
fast: false
disable-all: true

issues:
exclude-rules:
- path: _test\.go
linters:
- dupl
- text: "Errors unhandled"
linters:
- gosec
exclude-use-default: false
- revive
- staticcheck
- unconvert
- unparam
- unused
exclusions:
generated: lax
rules:
- linters:
- dupl
path: _test\.go
- linters:
- gosec
text: Errors unhandled
paths:
- internal/time/rate
- third_party$
- builtin$
- examples$
formatters:
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
1 change: 1 addition & 0 deletions limiter/limiter_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ type ExpirableOptions struct {
DefaultExpirationTTL time.Duration

// How frequently expire job triggers
//
// Deprecated: not used anymore
ExpireJobInterval time.Duration
}
2 changes: 1 addition & 1 deletion tollbooth.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func BuildKeys(lmt *limiter.Limiter, r *http.Request) [][]string {
remoteIP := libstring.RemoteIPFromIPLookup(lmt.GetIPLookup(), r)
remoteIP = libstring.CanonicalizeIP(remoteIP)
path := r.URL.Path
sliceKeys := make([][]string, 0)
sliceKeys := make([][]string, 0, 1)

lmtMethods := lmt.GetMethods()
lmtHeaders := lmt.GetHeaders()
Expand Down