Skip to content

Commit

Permalink
fix golangci-lint reported errors, update configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
paskal authored and umputun committed Aug 4, 2024
1 parent 8e030ce commit e20f7ef
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 25 deletions.
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

0 comments on commit e20f7ef

Please sign in to comment.