Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix golangci-lint reported errors, update configuration #30

Merged
merged 1 commit into from
Aug 4, 2024
Merged
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
27 changes: 7 additions & 20 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
linters-settings:
govet:
check-shadowing: true
golint:
min-confidence: 0
enable:
- shadow
gocyclo:
min-complexity: 15
maligned:
suggest-new: true
dupl:
threshold: 100
goconst:
Expand All @@ -26,44 +23,34 @@ linters-settings:

linters:
enable:
- megacheck
- staticcheck
- gosimple
- revive
- govet
- unconvert
- megacheck
- gas
- unused
- gosec
- gocyclo
- dupl
- misspell
- unparam
- unused
- typecheck
- ineffassign
- stylecheck
- gochecknoinits
- exportloopref
- gocritic
- nakedret
- gosimple
- prealloc
fast: false
disable-all: true

run:
output:
format: tab
skip-dirs:
- vendor

issues:
exclude-rules:
- text: 'Deferring unsafe method "Close" on type "io.ReadCloser"'
linters:
- gosec
- text: "should have a package comment, unless it's in another file for this package"
linters:
- golint
- path: _test\.go
linters:
- dupl
exclude-use-default: false
exclude-use-default: false
4 changes: 2 additions & 2 deletions benchmarks.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ func NewBenchmarks() *Benchmarks {
// Default is 15 minutes. The increase of this range will change memory utilization as each second of the range
// kept as benchData aggregate. The default means 15*60 = 900 seconds of data aggregate.
// Larger range allows for longer time periods to be benchmarked.
func (b *Benchmarks) WithTimeRange(max time.Duration) *Benchmarks {
func (b *Benchmarks) WithTimeRange(maximum time.Duration) *Benchmarks {
b.lock.Lock()
defer b.lock.Unlock()
b.maxTimeRange = max
b.maxTimeRange = maximum
return b
}

Expand Down
6 changes: 3 additions & 3 deletions logger/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ func WithBody(l *Middleware) {
}

// MaxBodySize sets size of the logged part of the request body.
func MaxBodySize(max int) Option {
func MaxBodySize(maximum int) Option {
return func(l *Middleware) {
if max >= 0 {
l.maxBodySize = max
if maximum >= 0 {
l.maxBodySize = maximum
}
}
}
Expand Down
Loading