update golangci-lint to 1.50 and fixes (#1828)
This commit is contained in:
parent
22479a289d
commit
02d2eab18c
2
.github/workflows/ci_golangci-lint.yml
vendored
2
.github/workflows/ci_golangci-lint.yml
vendored
|
@ -33,7 +33,7 @@ jobs:
|
||||||
uses: golangci/golangci-lint-action@v3
|
uses: golangci/golangci-lint-action@v3
|
||||||
with:
|
with:
|
||||||
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
|
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
|
||||||
version: v1.49
|
version: v1.50
|
||||||
# Optional: golangci-lint command line arguments.
|
# Optional: golangci-lint command line arguments.
|
||||||
args: --issues-exit-code=1 --timeout 10m
|
args: --issues-exit-code=1 --timeout 10m
|
||||||
# Optional: show only new issues if it's a pull request. The default value is `false`.
|
# Optional: show only new issues if it's a pull request. The default value is `false`.
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# see https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml
|
# https://github.com/golangci/golangci-lint/blob/master/.golangci.reference.yml
|
||||||
|
|
||||||
run:
|
run:
|
||||||
skip-dirs:
|
skip-dirs:
|
||||||
|
@ -23,16 +23,22 @@ linters-settings:
|
||||||
|
|
||||||
govet:
|
govet:
|
||||||
check-shadowing: true
|
check-shadowing: true
|
||||||
|
|
||||||
lll:
|
lll:
|
||||||
line-length: 140
|
line-length: 140
|
||||||
|
|
||||||
misspell:
|
misspell:
|
||||||
locale: US
|
locale: US
|
||||||
|
|
||||||
nolintlint:
|
nolintlint:
|
||||||
allow-leading-space: true # don't require machine-readable nolint directives (i.e. with no leading space)
|
allow-leading-space: true # don't require machine-readable nolint directives (i.e. with no leading space)
|
||||||
allow-unused: false # report any unused nolint directives
|
allow-unused: false # report any unused nolint directives
|
||||||
require-explanation: false # don't require an explanation for nolint directives
|
require-explanation: false # don't require an explanation for nolint directives
|
||||||
require-specific: false # don't require nolint directives to be specific about which linter is being skipped
|
require-specific: false # don't require nolint directives to be specific about which linter is being skipped
|
||||||
|
|
||||||
|
interfacebloat:
|
||||||
|
max: 12
|
||||||
|
|
||||||
linters:
|
linters:
|
||||||
enable-all: true
|
enable-all: true
|
||||||
disable:
|
disable:
|
||||||
|
@ -59,6 +65,7 @@ linters:
|
||||||
# - bidichk # Checks for dangerous unicode character sequences
|
# - bidichk # Checks for dangerous unicode character sequences
|
||||||
# - decorder # check declaration order and count of types, constants, variables and functions
|
# - decorder # check declaration order and count of types, constants, variables and functions
|
||||||
# - depguard # Go linter that checks if package imports are in a list of acceptable packages
|
# - depguard # Go linter that checks if package imports are in a list of acceptable packages
|
||||||
|
# - dupword # checks for duplicate words in the source code
|
||||||
# - durationcheck # check for two durations multiplied together
|
# - durationcheck # check for two durations multiplied together
|
||||||
# - errcheck # Errcheck is a program for checking for unchecked errors in go programs. These unchecked errors can be critical bugs in some cases
|
# - errcheck # Errcheck is a program for checking for unchecked errors in go programs. These unchecked errors can be critical bugs in some cases
|
||||||
# - exportloopref # checks for pointers to enclosing loop variables
|
# - exportloopref # checks for pointers to enclosing loop variables
|
||||||
|
@ -83,6 +90,7 @@ linters:
|
||||||
# - rowserrcheck # checks whether Err of rows is checked successfully
|
# - rowserrcheck # checks whether Err of rows is checked successfully
|
||||||
# - sqlclosecheck # Checks that sql.Rows and sql.Stmt are closed.
|
# - sqlclosecheck # Checks that sql.Rows and sql.Stmt are closed.
|
||||||
# - staticcheck # (megacheck): Staticcheck is a go vet on steroids, applying a ton of static analysis checks
|
# - staticcheck # (megacheck): Staticcheck is a go vet on steroids, applying a ton of static analysis checks
|
||||||
|
# - testableexamples # linter checks if examples are testable (have an expected output)
|
||||||
# - tenv # tenv is analyzer that detects using os.Setenv instead of t.Setenv since Go1.17
|
# - tenv # tenv is analyzer that detects using os.Setenv instead of t.Setenv since Go1.17
|
||||||
# - tparallel # tparallel detects inappropriate usage of t.Parallel() method in your Go test codes
|
# - tparallel # tparallel detects inappropriate usage of t.Parallel() method in your Go test codes
|
||||||
# - typecheck # Like the front-end of a Go compiler, parses and type-checks Go code
|
# - typecheck # Like the front-end of a Go compiler, parses and type-checks Go code
|
||||||
|
@ -171,6 +179,7 @@ linters:
|
||||||
|
|
||||||
- prealloc # Finds slice declarations that could potentially be preallocated
|
- prealloc # Finds slice declarations that could potentially be preallocated
|
||||||
|
|
||||||
|
|
||||||
issues:
|
issues:
|
||||||
max-issues-per-linter: 0
|
max-issues-per-linter: 0
|
||||||
max-same-issues: 10
|
max-same-issues: 10
|
||||||
|
|
|
@ -277,7 +277,7 @@ func (cw *CloudwatchSource) WatchLogGroupForStreams(out chan LogStreamTailConfig
|
||||||
Limit: cw.Config.DescribeLogStreamsLimit,
|
Limit: cw.Config.DescribeLogStreamsLimit,
|
||||||
},
|
},
|
||||||
func(page *cloudwatchlogs.DescribeLogStreamsOutput, lastPage bool) bool {
|
func(page *cloudwatchlogs.DescribeLogStreamsOutput, lastPage bool) bool {
|
||||||
cw.logger.Tracef("in helper of of DescribeLogStreamsPagesWithContext")
|
cw.logger.Tracef("in helper of DescribeLogStreamsPagesWithContext")
|
||||||
for _, event := range page.LogStreams {
|
for _, event := range page.LogStreams {
|
||||||
startFrom = page.NextToken
|
startFrom = page.NextToken
|
||||||
//we check if the stream has been written to recently enough to be monitored
|
//we check if the stream has been written to recently enough to be monitored
|
||||||
|
|
|
@ -137,7 +137,7 @@ func DefaultConfigPath(elem ...string) string {
|
||||||
return filepath.Join(elem...)
|
return filepath.Join(elem...)
|
||||||
}
|
}
|
||||||
|
|
||||||
// DefaultDataPath returns the the default path for a data resource.
|
// DefaultDataPath returns the default path for a data resource.
|
||||||
// "elem" parameters are path components relative to the default data directory.
|
// "elem" parameters are path components relative to the default data directory.
|
||||||
func DefaultDataPath(elem ...string) string {
|
func DefaultDataPath(elem ...string) string {
|
||||||
elem = append([]string{defaultDataDir}, elem...)
|
elem = append([]string{defaultDataDir}, elem...)
|
||||||
|
|
|
@ -13,7 +13,7 @@ import (
|
||||||
// ResetFilter allows to kill the bucket (without overflowing), if a particular condition is met.
|
// ResetFilter allows to kill the bucket (without overflowing), if a particular condition is met.
|
||||||
// An example would be a scenario to detect aggressive crawlers that *do not* fetch any static resources :
|
// An example would be a scenario to detect aggressive crawlers that *do not* fetch any static resources :
|
||||||
// type : leaky
|
// type : leaky
|
||||||
// filter: filter: "evt.Meta.log_type == 'http_access-log'
|
// filter: "evt.Meta.log_type == 'http_access-log'
|
||||||
// reset_filter: evt.Parsed.request endswith '.css'
|
// reset_filter: evt.Parsed.request endswith '.css'
|
||||||
// ....
|
// ....
|
||||||
// Thus, if the bucket receives a request that matches fetching a static resource (here css), it cancels itself
|
// Thus, if the bucket receives a request that matches fetching a static resource (here css), it cancels itself
|
||||||
|
|
Loading…
Reference in a new issue