From 1a2d87883576fce959d02e701353d3db7f82079e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 3 Jul 2024 10:48:11 +0100 Subject: [PATCH] [AUTOPR] Automatic updates (#252) * Update linter config and simplify code * Update dependencies --------- Co-authored-by: nicolaasuni-vonage --- .golangci.yml | 119 +++-------------- VERSION | 2 +- examples/service/.golangci.yml | 121 +++--------------- examples/service/go.mod | 10 +- examples/service/go.sum | 38 +++--- examples/service/internal/cli/bind_test.go | 1 - examples/service/internal/cli/cli_test.go | 1 - examples/service/internal/cli/config_test.go | 1 - go.mod | 14 +- go.sum | 38 +++--- pkg/awsopt/awsopt_test.go | 4 - pkg/bootstrap/bootstrap_test.go | 1 - pkg/bootstrap/config_test.go | 1 - pkg/config/config_test.go | 6 - pkg/decint/int64_test.go | 4 - pkg/decint/uint64_test.go | 4 - pkg/dnscache/dnscache_test.go | 8 +- pkg/encode/encode_test.go | 13 -- pkg/encrypt/encrypt_test.go | 8 -- pkg/enumbitmap/enumbitmap_test.go | 2 - pkg/enumdb/enumdb_test.go | 1 - pkg/filter/evaluate_contains_test.go | 1 - pkg/filter/evaluate_equal_test.go | 1 - pkg/filter/evaluate_equalfold_test.go | 1 - pkg/filter/evaluate_gt_test.go | 1 - pkg/filter/evaluate_gte_test.go | 1 - pkg/filter/evaluate_hasprefix_test.go | 1 - pkg/filter/evaluate_hassuffix_test.go | 1 - pkg/filter/evaluate_lt_test.go | 1 - pkg/filter/evaluate_lte_test.go | 1 - pkg/filter/evaluate_not_test.go | 1 - pkg/filter/evaluate_regexp_test.go | 1 - pkg/filter/filter.go | 2 +- pkg/filter/filter_test.go | 7 +- pkg/filter/options_test.go | 4 - pkg/healthcheck/checks_test.go | 1 - pkg/healthcheck/handler.go | 2 - pkg/healthcheck/handler_test.go | 1 - pkg/httpclient/client_test.go | 3 +- pkg/httpretrier/httpretrier_test.go | 5 - pkg/httpreverseproxy/client_test.go | 2 - pkg/httpserver/config_test.go | 3 - pkg/httpserver/httpserver_test.go | 2 - pkg/httpserver/options_test.go | 1 - pkg/httputil/jsendx/deprecated_test.go | 1 - pkg/httputil/jsendx/jsendx_test.go | 1 - pkg/httputil/link_test.go | 1 - pkg/httputil/request_test.go | 10 +- pkg/httputil/response_test.go | 1 - pkg/ipify/client_test.go | 2 - pkg/jwt/jwt_test.go | 4 - pkg/kafka/consumer_test.go | 4 - pkg/kafka/producer_test.go | 2 - pkg/kafkacgo/consumer_test.go | 4 - pkg/kafkacgo/producer_test.go | 2 - pkg/logging/format_test.go | 1 - pkg/logging/level_test.go | 1 - pkg/logging/logging_test.go | 1 - pkg/logging/options_test.go | 2 - pkg/metrics/prometheus/client_test.go | 1 - pkg/metrics/statsd/client_test.go | 1 - pkg/mysqllock/mysqllock_test.go | 2 - pkg/paging/paging_test.go | 2 - pkg/passwordpwned/client_test.go | 1 - pkg/passwordpwned/passwordpwned.go | 2 +- pkg/passwordpwned/passwordpwned_test.go | 1 - pkg/periodic/periodic_test.go | 1 - pkg/profiling/profiling_test.go | 1 - pkg/retrier/retrier_test.go | 3 - pkg/s3/client_test.go | 8 -- pkg/s3/options_test.go | 2 - pkg/slack/client_test.go | 3 - pkg/sleuth/client_test.go | 5 - pkg/sleuth/sleuth_test.go | 10 -- pkg/sliceutil/stats_test.go | 2 - pkg/sqlconn/config_test.go | 1 - pkg/sqlconn/sqlconn_test.go | 5 - pkg/sqltransaction/sqltransaction_test.go | 2 - pkg/sqlutil/sqlinclause_test.go | 6 - pkg/sqlutil/sqlutil.go | 2 +- pkg/sqlutil/sqlutil_test.go | 4 - pkg/sqlxtransaction/sqlxtransaction_test.go | 2 - pkg/sqs/client_test.go | 10 -- pkg/sqs/options_test.go | 2 - pkg/stringkey/stringkey_test.go | 2 - pkg/stringmetric/stringmetric.go | 2 +- pkg/stringmetric/stringmetric_test.go | 2 - .../tsslice/example_tsslice_test.go | 2 +- pkg/threadsafe/tsslice/tsslice_test.go | 2 +- pkg/timeutil/duration_test.go | 4 - pkg/traceid/traceid_test.go | 1 - pkg/typeutil/typeutil_test.go | 2 - pkg/uid/uid_test.go | 6 +- pkg/uidc/uidc_test.go | 6 +- pkg/validator/custom_test.go | 1 - pkg/validator/options_test.go | 3 - pkg/validator/validator_test.go | 2 - 97 files changed, 106 insertions(+), 486 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index f5260a1e..3821c648 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -55,107 +55,18 @@ issues: # fix: true linters: - enable: - - asasalint # check for pass []any as any in variadic func(...any) [fast: false, auto-fix: false] - - asciicheck # Simple linter to check that your code does not contain non-ASCII identifiers [fast: true, auto-fix: false] - - bidichk # Checks for dangerous unicode character sequences [fast: true, auto-fix: false] - - bodyclose # checks whether HTTP response body is closed successfully [fast: false, auto-fix: false] - - containedctx # containedctx is a linter that detects struct contained context.Context field [fast: false, auto-fix: false] - - contextcheck # check whether the function uses a non-inherited context [fast: false, auto-fix: false] - - cyclop # checks function and package cyclomatic complexity [fast: false, auto-fix: false] - - decorder # check declaration order and count of types, constants, variables and functions [fast: true, auto-fix: false] - #- depguard # Go linter that checks if package imports are in a list of acceptable packages [fast: true, auto-fix: false] - - dogsled # Checks assignments with too many blank identifiers (e.g. x, _, _, _, := f()) [fast: true, auto-fix: false] - - dupl # Tool for code clone detection [fast: true, auto-fix: false] - - dupword # checks for duplicate words in the source code [fast: true, auto-fix: true] - - durationcheck # check for two durations multiplied together [fast: false, auto-fix: false] - - errcheck # errcheck is a program for checking for unchecked errors in Go code. These unchecked errors can be critical bugs in some cases [fast: false, auto-fix: false] - - errchkjson # Checks types passed to the json encoding functions. Reports unsupported types and optionally reports occasions, where the check for the returned error can be omitted. [fast: false, auto-fix: false] - - errname # Checks that sentinel errors are prefixed with the `Err` and error types are suffixed with the `Error`. [fast: false, auto-fix: false] - - errorlint # errorlint is a linter for that can be used to find code that will cause problems with the error wrapping scheme introduced in Go 1.13. [fast: false, auto-fix: false] - #- execinquery # execinquery is a linter about query string checker in Query function which reads your Go src files and warning it finds [fast: false, auto-fix: false] - - exhaustive # check exhaustiveness of enum switch statements [fast: false, auto-fix: false] - #- exhaustruct # Checks if all structure fields are initialized [fast: false, auto-fix: false] - - exportloopref # checks for pointers to enclosing loop variables [fast: false, auto-fix: false] - - forbidigo # Forbids identifiers [fast: false, auto-fix: false] - - forcetypeassert # finds forced type assertions [fast: true, auto-fix: false] - - funlen # Tool for detection of long functions [fast: true, auto-fix: false] - - gci # Gci controls Go package import order and makes it always deterministic. [fast: true, auto-fix: false] - - ginkgolinter # enforces standards of using ginkgo and gomega [fast: false, auto-fix: false] - - gocheckcompilerdirectives # Checks that go compiler directive comments (//go:) are valid. [fast: true, auto-fix: false] - - gochecknoglobals # check that no global variables exist [fast: false, auto-fix: false] - - gochecknoinits # Checks that no init functions are present in Go code [fast: true, auto-fix: false] - - gochecksumtype # Run exhaustiveness checks on Go "sum types" [fast: false, auto-fix: false] - - gocognit # Computes and checks the cognitive complexity of functions [fast: true, auto-fix: false] - - goconst # Finds repeated strings that could be replaced by a constant [fast: true, auto-fix: false] - - gocritic # Provides diagnostics that check for bugs, performance and style issues. [fast: false, auto-fix: false] - - gocyclo # Computes and checks the cyclomatic complexity of functions [fast: true, auto-fix: false] - - godot # Check if comments end in a period [fast: true, auto-fix: true] - - godox # Tool for detection of FIXME, TODO and other comment keywords [fast: true, auto-fix: false] - #- goerr113 # Go linter to check the errors handling expressions [fast: false, auto-fix: false] - - gofmt # Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification [fast: true, auto-fix: true] - - gofumpt # Gofumpt checks whether code was gofumpt-ed. [fast: true, auto-fix: true] - - goheader # Checks is file header matches to pattern [fast: true, auto-fix: false] - - goimports # Check import statements are formatted according to the 'goimport' command. Reformat imports in autofix mode. [fast: true, auto-fix: true] - #- gomnd # An analyzer to detect magic numbers. [fast: true, auto-fix: false] - - gomoddirectives # Manage the use of 'replace', 'retract', and 'excludes' directives in go.mod. [fast: true, auto-fix: false] - - gomodguard # Allow and block list linter for direct Go module dependencies. This is different from depguard where there are different block types for example version constraints and module recommendations. [fast: true, auto-fix: false] - - goprintffuncname # Checks that printf-like functions are named with `f` at the end [fast: true, auto-fix: false] - - gosec # (gas): Inspects source code for security problems [fast: false, auto-fix: false] - - gosimple # (megacheck): Linter for Go source code that specializes in simplifying code [fast: false, auto-fix: false] - - gosmopolitan # Report certain i18n/l10n anti-patterns in your Go codebase [fast: false, auto-fix: false] - - govet # (vet, vetshadow): Vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string [fast: false, auto-fix: false] - - grouper # An analyzer to analyze expression groups. [fast: true, auto-fix: false] - - importas # Enforces consistent import aliases [fast: false, auto-fix: false] - - inamedparam # reports interfaces with unnamed method parameters [fast: true, auto-fix: false] - - ineffassign # Detects when assignments to existing variables are not used [fast: true, auto-fix: false] - - interfacebloat # A linter that checks the number of methods inside an interface. [fast: true, auto-fix: false] - #- ireturn # Accept Interfaces, Return Concrete Types [fast: false, auto-fix: false] - #- lll # Reports long lines [fast: true, auto-fix: false] - - loggercheck # (logrlint): Checks key value pairs for common logger libraries (kitlog,klog,logr,zap). [fast: false, auto-fix: false] - - maintidx # maintidx measures the maintainability index of each function. [fast: true, auto-fix: false] - - makezero # Finds slice declarations with non-zero initial length [fast: false, auto-fix: false] - - mirror # reports wrong mirror patterns of bytes/strings usage [fast: false, auto-fix: false] - - misspell # Finds commonly misspelled English words in comments [fast: true, auto-fix: true] - #- musttag # enforce field tags in (un)marshaled structs [fast: false, auto-fix: false] - - nakedret # Finds naked returns in functions greater than a specified function length [fast: true, auto-fix: false] - - nestif # Reports deeply nested if statements [fast: true, auto-fix: false] - - nilerr # Finds the code that returns nil even if it checks that the error is not nil. [fast: false, auto-fix: false] - - nilnil # Checks that there is no simultaneous return of `nil` error and an invalid value. [fast: false, auto-fix: false] - #- nlreturn # nlreturn checks for a new line before return and branch statements to increase code clarity [fast: true, auto-fix: false] - - noctx # noctx finds sending http request without context.Context [fast: false, auto-fix: false] - - nolintlint # Reports ill-formed or insufficient nolint directives [fast: true, auto-fix: false] - - nonamedreturns # Reports all named returns [fast: false, auto-fix: false] - - nosprintfhostport # Checks for misuse of Sprintf to construct a host with port in a URL. [fast: true, auto-fix: false] - - paralleltest # paralleltest detects missing usage of t.Parallel() method in your Go test [fast: false, auto-fix: false] - - perfsprint # Checks that fmt.Sprintf can be replaced with a faster alternative. [fast: false, auto-fix: false] - - prealloc # Finds slice declarations that could potentially be pre-allocated [fast: true, auto-fix: false] - - predeclared # find code that shadows one of Go's predeclared identifiers [fast: true, auto-fix: false] - - promlinter # Check Prometheus metrics naming via promlint [fast: true, auto-fix: false] - - protogetter # Reports direct reads from proto message fields when getters should be used [fast: false, auto-fix: true] - - reassign # Checks that package variables are not reassigned [fast: false, auto-fix: false] - - revive # Fast, configurable, extensible, flexible, and beautiful linter for Go. Drop-in replacement of golint. [fast: false, auto-fix: false] - - rowserrcheck # checks whether Err of rows is checked successfully [fast: false, auto-fix: false] - - sloglint # Detects the wrong usage of `slog` that a user forgets to dispatch with `Send` or `Msg`. [fast: false, auto-fix: false] - - spancheck # spancheck is a linter that detects the usage of context.Context.Value method. [fast: false, auto-fix: false] - - sqlclosecheck # Checks that sql.Rows and sql.Stmt are closed. [fast: false, auto-fix: false] - - staticcheck # (megacheck): It's a set of rules from staticcheck. It's not the same thing as the staticcheck binary. The author of staticcheck doesn't support or approve the use of staticcheck as a library inside golangci-lint. [fast: false, auto-fix: false] - - stylecheck # Stylecheck is a replacement for golint [fast: false, auto-fix: false] - - tagalign # check that struct tags are well aligned [fast: true, auto-fix: true] - #- tagliatelle # Checks the struct tags. [fast: true, auto-fix: false] - - tenv # tenv is analyzer that detects using os.Setenv instead of t.Setenv since Go1.17 [fast: false, auto-fix: false] - - testableexamples # linter checks if examples are testable (have an expected output) [fast: true, auto-fix: false] - - testifylint # Checks usage of github.com/stretchr/testify. [fast: false, auto-fix: false] - #- testpackage # linter that makes you use a separate _test package [fast: true, auto-fix: false] - - thelper # thelper detects Go test helpers without t.Helper() call and checks the consistency of test helpers [fast: false, auto-fix: false] - - tparallel # tparallel detects inappropriate usage of t.Parallel() method in your Go test codes [fast: false, auto-fix: false] - - unconvert # Remove unnecessary type conversions [fast: false, auto-fix: false] - - unparam # Reports unused function parameters [fast: false, auto-fix: false] - - unused # (megacheck): Checks Go code for unused constants, variables, functions and types [fast: false, auto-fix: false] - - usestdlibvars # A linter that detect the possibility to use variables/constants from the Go standard library. [fast: true, auto-fix: false] - #- varnamelen # checks that the length of a variable's name matches its scope [fast: false, auto-fix: false] - - wastedassign # wastedassign finds wasted assignment statements. [fast: false, auto-fix: false] - - whitespace # Tool for detection of leading and trailing whitespace [fast: true, auto-fix: true] - - wrapcheck # Checks that errors returned from external packages are wrapped [fast: false, auto-fix: false] - - wsl # Whitespace Linter - Forces you to use empty lines! [fast: true, auto-fix: false] - - zerologlint # Detects the wrong usage of `zerolog` that a user forgets to dispatch with `Send` or `Msg`. [fast: false, auto-fix: false] + enable-all: true + disable: + - depguard # Go linter that checks if package imports are in a list of acceptable packages [fast: true, auto-fix: false] + - execinquery # execinquery is a linter about query string checker in Query function which reads your Go src files and warning it finds [fast: false, auto-fix: false] + - exhaustruct # Checks if all structure fields are initialized [fast: false, auto-fix: false] + - err113 # Go linter to check the errors handling expressions [fast: false, auto-fix: false] + - gomnd # An analyzer to detect magic numbers. [fast: true, auto-fix: false] + - ireturn # Accept Interfaces, Return Concrete Types [fast: false, auto-fix: false] + - lll # Reports long lines [fast: true, auto-fix: false] + - mnd # An analyzer to detect magic numbers. [fast: true, auto-fix: false] + - musttag # enforce field tags in (un)marshaled structs [fast: false, auto-fix: false] + - nlreturn # Accept Nil, Return Non-Nil [fast: false, auto-fix: false] + - tagliatelle # Checks the struct tags. [fast: true, auto-fix: false] + - testpackage # linter that makes you use a separate _test package [fast: true, auto-fix: false] + - varnamelen # checks that the length of a variable's name matches its scope [fast: false, auto-fix: false] diff --git a/VERSION b/VERSION index 95784efd..d8ac93be 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.93.0 +1.93.1 diff --git a/examples/service/.golangci.yml b/examples/service/.golangci.yml index 42f14252..a831c8cf 100644 --- a/examples/service/.golangci.yml +++ b/examples/service/.golangci.yml @@ -55,107 +55,20 @@ issues: #fix: true linters: - enable: - - asasalint # check for pass []any as any in variadic func(...any) [fast: false, auto-fix: false] - - asciicheck # Simple linter to check that your code does not contain non-ASCII identifiers [fast: true, auto-fix: false] - - bidichk # Checks for dangerous unicode character sequences [fast: true, auto-fix: false] - - bodyclose # checks whether HTTP response body is closed successfully [fast: false, auto-fix: false] - - containedctx # containedctx is a linter that detects struct contained context.Context field [fast: false, auto-fix: false] - - contextcheck # check whether the function uses a non-inherited context [fast: false, auto-fix: false] - - cyclop # checks function and package cyclomatic complexity [fast: false, auto-fix: false] - - decorder # check declaration order and count of types, constants, variables and functions [fast: true, auto-fix: false] - #- depguard # Go linter that checks if package imports are in a list of acceptable packages [fast: true, auto-fix: false] - - dogsled # Checks assignments with too many blank identifiers (e.g. x, _, _, _, := f()) [fast: true, auto-fix: false] - - dupl # Tool for code clone detection [fast: true, auto-fix: false] - - dupword # checks for duplicate words in the source code [fast: true, auto-fix: true] - - durationcheck # check for two durations multiplied together [fast: false, auto-fix: false] - - errcheck # errcheck is a program for checking for unchecked errors in Go code. These unchecked errors can be critical bugs in some cases [fast: false, auto-fix: false] - - errchkjson # Checks types passed to the json encoding functions. Reports unsupported types and optionally reports occasions, where the check for the returned error can be omitted. [fast: false, auto-fix: false] - - errname # Checks that sentinel errors are prefixed with the `Err` and error types are suffixed with the `Error`. [fast: false, auto-fix: false] - - errorlint # errorlint is a linter for that can be used to find code that will cause problems with the error wrapping scheme introduced in Go 1.13. [fast: false, auto-fix: false] - #- execinquery # execinquery is a linter about query string checker in Query function which reads your Go src files and warning it finds [fast: false, auto-fix: false] - - exhaustive # check exhaustiveness of enum switch statements [fast: false, auto-fix: false] - #- exhaustruct # Checks if all structure fields are initialized [fast: false, auto-fix: false] - - exportloopref # checks for pointers to enclosing loop variables [fast: false, auto-fix: false] - - forbidigo # Forbids identifiers [fast: false, auto-fix: false] - - forcetypeassert # finds forced type assertions [fast: true, auto-fix: false] - - funlen # Tool for detection of long functions [fast: true, auto-fix: false] - - gci # Gci controls Go package import order and makes it always deterministic. [fast: true, auto-fix: false] - - ginkgolinter # enforces standards of using ginkgo and gomega [fast: false, auto-fix: false] - - gocheckcompilerdirectives # Checks that go compiler directive comments (//go:) are valid. [fast: true, auto-fix: false] - - gochecknoglobals # check that no global variables exist [fast: false, auto-fix: false] - - gochecknoinits # Checks that no init functions are present in Go code [fast: true, auto-fix: false] - - gochecksumtype # Run exhaustiveness checks on Go "sum types" [fast: false, auto-fix: false] - - gocognit # Computes and checks the cognitive complexity of functions [fast: true, auto-fix: false] - - goconst # Finds repeated strings that could be replaced by a constant [fast: true, auto-fix: false] - - gocritic # Provides diagnostics that check for bugs, performance and style issues. [fast: false, auto-fix: false] - - gocyclo # Computes and checks the cyclomatic complexity of functions [fast: true, auto-fix: false] - - godot # Check if comments end in a period [fast: true, auto-fix: true] - - godox # Tool for detection of FIXME, TODO and other comment keywords [fast: true, auto-fix: false] - #- goerr113 # Go linter to check the errors handling expressions [fast: false, auto-fix: false] - - gofmt # Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification [fast: true, auto-fix: true] - - gofumpt # Gofumpt checks whether code was gofumpt-ed. [fast: true, auto-fix: true] - - goheader # Checks is file header matches to pattern [fast: true, auto-fix: false] - - goimports # Check import statements are formatted according to the 'goimport' command. Reformat imports in autofix mode. [fast: true, auto-fix: true] - #- gomnd # An analyzer to detect magic numbers. [fast: true, auto-fix: false] - #- gomoddirectives # Manage the use of 'replace', 'retract', and 'excludes' directives in go.mod. [fast: true, auto-fix: false] - - gomodguard # Allow and block list linter for direct Go module dependencies. This is different from depguard where there are different block types for example version constraints and module recommendations. [fast: true, auto-fix: false] - - goprintffuncname # Checks that printf-like functions are named with `f` at the end [fast: true, auto-fix: false] - - gosec # (gas): Inspects source code for security problems [fast: false, auto-fix: false] - - gosimple # (megacheck): Linter for Go source code that specializes in simplifying code [fast: false, auto-fix: false] - - gosmopolitan # Report certain i18n/l10n anti-patterns in your Go codebase [fast: false, auto-fix: false] - - govet # (vet, vetshadow): Vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string [fast: false, auto-fix: false] - - grouper # An analyzer to analyze expression groups. [fast: true, auto-fix: false] - - importas # Enforces consistent import aliases [fast: false, auto-fix: false] - - inamedparam # reports interfaces with unnamed method parameters [fast: true, auto-fix: false] - - ineffassign # Detects when assignments to existing variables are not used [fast: true, auto-fix: false] - - interfacebloat # A linter that checks the number of methods inside an interface. [fast: true, auto-fix: false] - #- ireturn # Accept Interfaces, Return Concrete Types [fast: false, auto-fix: false] - #- lll # Reports long lines [fast: true, auto-fix: false] - - loggercheck # (logrlint): Checks key value pairs for common logger libraries (kitlog,klog,logr,zap). [fast: false, auto-fix: false] - - maintidx # maintidx measures the maintainability index of each function. [fast: true, auto-fix: false] - - makezero # Finds slice declarations with non-zero initial length [fast: false, auto-fix: false] - - mirror # reports wrong mirror patterns of bytes/strings usage [fast: false, auto-fix: false] - - misspell # Finds commonly misspelled English words in comments [fast: true, auto-fix: true] - #- musttag # enforce field tags in (un)marshaled structs [fast: false, auto-fix: false] - - nakedret # Finds naked returns in functions greater than a specified function length [fast: true, auto-fix: false] - - nestif # Reports deeply nested if statements [fast: true, auto-fix: false] - - nilerr # Finds the code that returns nil even if it checks that the error is not nil. [fast: false, auto-fix: false] - - nilnil # Checks that there is no simultaneous return of `nil` error and an invalid value. [fast: false, auto-fix: false] - #- nlreturn # nlreturn checks for a new line before return and branch statements to increase code clarity [fast: true, auto-fix: false] - - noctx # noctx finds sending http request without context.Context [fast: false, auto-fix: false] - - nolintlint # Reports ill-formed or insufficient nolint directives [fast: true, auto-fix: false] - - nonamedreturns # Reports all named returns [fast: false, auto-fix: false] - - nosprintfhostport # Checks for misuse of Sprintf to construct a host with port in a URL. [fast: true, auto-fix: false] - - paralleltest # paralleltest detects missing usage of t.Parallel() method in your Go test [fast: false, auto-fix: false] - - perfsprint # Checks that fmt.Sprintf can be replaced with a faster alternative. [fast: false, auto-fix: false] - - prealloc # Finds slice declarations that could potentially be pre-allocated [fast: true, auto-fix: false] - - predeclared # find code that shadows one of Go's predeclared identifiers [fast: true, auto-fix: false] - #- promlinter # Check Prometheus metrics naming via promlint [fast: true, auto-fix: false] - - protogetter # Reports direct reads from proto message fields when getters should be used [fast: false, auto-fix: true] - - reassign # Checks that package variables are not reassigned [fast: false, auto-fix: false] - - revive # Fast, configurable, extensible, flexible, and beautiful linter for Go. Drop-in replacement of golint. [fast: false, auto-fix: false] - - rowserrcheck # checks whether Err of rows is checked successfully [fast: false, auto-fix: false] - - sloglint # Detects the wrong usage of `slog` that a user forgets to dispatch with `Send` or `Msg`. [fast: false, auto-fix: false] - - spancheck # spancheck is a linter that detects the usage of context.Context.Value method [fast: false, auto-fix: false] - - sqlclosecheck # Checks that sql.Rows and sql.Stmt are closed. [fast: false, auto-fix: false] - - staticcheck # (megacheck): It's a set of rules from staticcheck. It's not the same thing as the staticcheck binary. The author of staticcheck doesn't support or approve the use of staticcheck as a library inside golangci-lint. [fast: false, auto-fix: false] - - stylecheck # Stylecheck is a replacement for golint [fast: false, auto-fix: false] - - tagalign # check that struct tags are well aligned [fast: true, auto-fix: true] - #- tagliatelle # Checks the struct tags. [fast: true, auto-fix: false] - - tenv # tenv is analyzer that detects using os.Setenv instead of t.Setenv since Go1.17 [fast: false, auto-fix: false] - - testableexamples # linter checks if examples are testable (have an expected output) [fast: true, auto-fix: false] - - testifylint # Checks usage of github.com/stretchr/testify. [fast: false, auto-fix: false] - #- testpackage # linter that makes you use a separate _test package [fast: true, auto-fix: false] - - thelper # thelper detects Go test helpers without t.Helper() call and checks the consistency of test helpers [fast: false, auto-fix: false] - - tparallel # tparallel detects inappropriate usage of t.Parallel() method in your Go test codes [fast: false, auto-fix: false] - - unconvert # Remove unnecessary type conversions [fast: false, auto-fix: false] - - unparam # Reports unused function parameters [fast: false, auto-fix: false] - - unused # (megacheck): Checks Go code for unused constants, variables, functions and types [fast: false, auto-fix: false] - - usestdlibvars # A linter that detect the possibility to use variables/constants from the Go standard library. [fast: true, auto-fix: false] - #- varnamelen # checks that the length of a variable's name matches its scope [fast: false, auto-fix: false] - - wastedassign # wastedassign finds wasted assignment statements. [fast: false, auto-fix: false] - - whitespace # Tool for detection of leading and trailing whitespace [fast: true, auto-fix: true] - - wrapcheck # Checks that errors returned from external packages are wrapped [fast: false, auto-fix: false] - - wsl # Whitespace Linter - Forces you to use empty lines! [fast: true, auto-fix: false] - - zerologlint # Detects the wrong usage of `zerolog` that a user forgets to dispatch with `Send` or `Msg`. [fast: false, auto-fix: false] + enable-all: true + disable: + - depguard # Go linter that checks if package imports are in a list of acceptable packages [fast: true, auto-fix: false] + - execinquery # execinquery is a linter about query string checker in Query function which reads your Go src files and warning it finds [fast: false, auto-fix: false] + - exhaustruct # Checks if all structure fields are initialized [fast: false, auto-fix: false] + - err113 # Go linter to check the errors handling expressions [fast: false, auto-fix: false] + - gomnd # An analyzer to detect magic numbers. [fast: true, auto-fix: false] + - gomoddirectives # Manage the use of 'replace', 'retract', and 'excludes' directives in go.mod. [fast: true, auto-fix: false] + - ireturn # Accept Interfaces, Return Concrete Types [fast: false, auto-fix: false] + - lll # Reports long lines [fast: true, auto-fix: false] + - mnd # An analyzer to detect magic numbers. [fast: true, auto-fix: false] + - musttag # enforce field tags in (un)marshaled structs [fast: false, auto-fix: false] + - nlreturn # nlreturn checks for a new line before return and branch statements to increase code clarity [fast: true, auto-fix: false] + - promlinter # Check Prometheus metrics naming via promlint [fast: true, auto-fix: false] + - tagliatelle # Checks the struct tags. [fast: true, auto-fix: false] + - testpackage # linter that makes you use a separate _test package [fast: true, auto-fix: false] + - varnamelen # checks that the length of a variable's name matches its scope [fast: false, auto-fix: false] diff --git a/examples/service/go.mod b/examples/service/go.mod index 0344a9f6..f59fa75c 100644 --- a/examples/service/go.mod +++ b/examples/service/go.mod @@ -7,7 +7,7 @@ toolchain go1.22.4 replace github.com/Vonage/gosrvlib => ../.. require ( - github.com/Vonage/gosrvlib v1.93.0 + github.com/Vonage/gosrvlib v1.93.1 github.com/golang/mock v1.6.0 github.com/jstemmer/go-junit-report/v2 v2.1.0 github.com/prometheus/client_golang v1.19.1 @@ -94,9 +94,9 @@ require ( go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0 // indirect - go.opentelemetry.io/otel v1.27.0 // indirect - go.opentelemetry.io/otel/metric v1.27.0 // indirect - go.opentelemetry.io/otel/trace v1.27.0 // indirect + go.opentelemetry.io/otel v1.28.0 // indirect + go.opentelemetry.io/otel/metric v1.28.0 // indirect + go.opentelemetry.io/otel/trace v1.28.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/crypto v0.24.0 // indirect golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 // indirect @@ -112,7 +112,7 @@ require ( google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect - google.golang.org/grpc v1.64.0 // indirect + google.golang.org/grpc v1.65.0 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/examples/service/go.sum b/examples/service/go.sum index 807a58dd..68adc6f1 100644 --- a/examples/service/go.sum +++ b/examples/service/go.sum @@ -1,3 +1,5 @@ +cel.dev/expr v0.15.0 h1:O1jzfJCQBfL5BFoYktaxwIhuttaQPsVWerH9/EEKx0w= +cel.dev/expr v0.15.0/go.mod h1:TRSuuV7DlVCE/uwv5QbAiW/v8l5O8C4eEPHeu7gf7Sg= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.115.0 h1:CnFSK6Xo3lDYRoBKEcAtia6VSC837/ZkJuRduSFnr14= cloud.google.com/go v0.115.0/go.mod h1:8jIM5vVgoAEoiVxQ/O4BFTfHqulPZgs/ufEzMcFMdWU= @@ -290,8 +292,8 @@ github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.15 h1:I9zMeF10 github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.15/go.mod h1:9xWJ3Q/S6Ojusz1UIkfycgD1mGirJfLLKqq3LPT7WN8= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.13 h1:Eq2THzHt6P41mpjS2sUzz/3dJYFRqdWZ+vQaEMm98EM= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.13/go.mod h1:FgwTca6puegxgCInYwGjmd4tB9195Dd6LCuA+8MjpWw= -github.com/aws/aws-sdk-go-v2/service/s3 v1.57.1 h1:aHPtNY87GZ214N4rShgIo+5JQz7ICrJ50i17JbueUTw= -github.com/aws/aws-sdk-go-v2/service/s3 v1.57.1/go.mod h1:hdV0NTYd0RwV4FvNKhKUNbPLZoq9CTr/lke+3I7aCAI= +github.com/aws/aws-sdk-go-v2/service/s3 v1.58.0 h1:4rhV0Hn+bf8IAIUphRX1moBcEvKJipCPmswMCl6Q5mw= +github.com/aws/aws-sdk-go-v2/service/s3 v1.58.0/go.mod h1:hdV0NTYd0RwV4FvNKhKUNbPLZoq9CTr/lke+3I7aCAI= github.com/aws/aws-sdk-go-v2/service/sqs v1.34.1 h1:Tp1oKSfWHE8fTz0H+DuD05cXPJ96Z6Rko0W/dAp7wJ0= github.com/aws/aws-sdk-go-v2/service/sqs v1.34.1/go.mod h1:5gGM2xv51W5Hkyr3vj7JTEf/b5oOCb7rXcEVbXrcTAU= github.com/aws/aws-sdk-go-v2/service/sso v1.22.1 h1:p1GahKIjyMDZtiKoIn0/jAj/TkMzfzndDv5+zi2Mhgc= @@ -322,8 +324,8 @@ github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f h1:WBZRG4aNOuI15bLRrCgN8fCq8E5Xuty6jGbmSNEvSsU= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/xds/go v0.0.0-20240318125728-8a4994d93e50 h1:DBmgJDC9dTfkVyGgipamEh2BpGYxScCH1TOF1LL1cXc= -github.com/cncf/xds/go v0.0.0-20240318125728-8a4994d93e50/go.mod h1:5e1+Vvlzido69INQaVO6d87Qn543Xr6nooe9Kz7oBFM= +github.com/cncf/xds/go v0.0.0-20240423153145-555b57ec207b h1:ga8SEFjZ60pxLcmhnThWgvH2wg8376yUJmPhEH4H3kw= +github.com/cncf/xds/go v0.0.0-20240423153145-555b57ec207b/go.mod h1:W+zGtBO5Y1IgJhy4+A9GOqVhqLpfZi+vwmdNXUehLA8= github.com/confluentinc/confluent-kafka-go v1.9.2 h1:gV/GxhMBUb03tFWkN+7kdhg+zf+QUM+wVkI9zwh770Q= github.com/confluentinc/confluent-kafka-go v1.9.2/go.mod h1:ptXNqsuDfYbAE/LBW6pnwWZElUoWxHoV8E43DCrliyo= github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4= @@ -393,8 +395,8 @@ github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69 github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.2.0 h1:uCdmnmatrKCgMBlM4rMuJZWOkPDqdbZPnrMXDY4gI68= -github.com/golang/glog v1.2.0/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= +github.com/golang/glog v1.2.1 h1:OptwRhECazUx5ix5TTWC3EZhsZEHWcYWY4FQHTIubm4= +github.com/golang/glog v1.2.1/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -680,10 +682,10 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= -github.com/tecnickcom/farmhash64 v1.9.11 h1:BQcdyzrxKujDobiTgeGIiV0Ip3yDV+ZdSAew01vCPIg= -github.com/tecnickcom/farmhash64 v1.9.11/go.mod h1:RvRiToh45tYnFuB+N/oxZ3pBD6uD0ALturs3buEFfGA= -github.com/tecnickcom/statsd v1.0.10 h1:V2CxzAsFx5mUDIso679JTgNp37HXn576NvNNWwAM7lY= -github.com/tecnickcom/statsd v1.0.10/go.mod h1:JNpNj3y4wsg5Y+25AuOw5XUM/1v2GhUEBPZRmWE4Kzo= +github.com/tecnickcom/farmhash64 v1.9.12 h1:leGZ6nk2pk6qXGbZET55ZnasuVTaZP/2hOvXwmUmwzE= +github.com/tecnickcom/farmhash64 v1.9.12/go.mod h1:RvRiToh45tYnFuB+N/oxZ3pBD6uD0ALturs3buEFfGA= +github.com/tecnickcom/statsd v1.0.11 h1:Hc8mj+fneBbrbWLCzzvgpYZffa8sjzilhqCbij1XMhY= +github.com/tecnickcom/statsd v1.0.11/go.mod h1:JNpNj3y4wsg5Y+25AuOw5XUM/1v2GhUEBPZRmWE4Kzo= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926 h1:G3dpKMzFDjgEh2q1Z7zUUtKa8ViPtH+ocF0bE0g00O8= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/undefinedlabs/go-mpatch v1.0.7 h1:943FMskd9oqfbZV0qRVKOUsXQhTLXL0bQTVbQSpzmBs= @@ -709,14 +711,14 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.5 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0/go.mod h1:BMsdeOxN04K0L5FNUBfjFdvwWGNe/rkmSwH4Aelu/X0= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0 h1:9l89oX4ba9kHbBol3Xin3leYJ+252h0zszDtBwyKe2A= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0/go.mod h1:XLZfZboOJWHNKUv7eH0inh0E9VV6eWDFB/9yJyTLPp0= -go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg= -go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ= -go.opentelemetry.io/otel/metric v1.27.0 h1:hvj3vdEKyeCi4YaYfNjv2NUje8FqKqUY8IlF0FxV/ik= -go.opentelemetry.io/otel/metric v1.27.0/go.mod h1:mVFgmRlhljgBiuk/MP/oKylr4hs85GZAylncepAX/ak= +go.opentelemetry.io/otel v1.28.0 h1:/SqNcYk+idO0CxKEUOtKQClMK/MimZihKYMruSMViUo= +go.opentelemetry.io/otel v1.28.0/go.mod h1:q68ijF8Fc8CnMHKyzqL6akLO46ePnjkgfIMIjUIX9z4= +go.opentelemetry.io/otel/metric v1.28.0 h1:f0HGvSl1KRAU1DLgLGFjrwVyismPlnuU6JD6bOeuA5Q= +go.opentelemetry.io/otel/metric v1.28.0/go.mod h1:Fb1eVBFZmLVTMb6PPohq3TO9IIhUisDsbJoL/+uQW4s= go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw= go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg= -go.opentelemetry.io/otel/trace v1.27.0 h1:IqYb813p7cmbHk0a5y6pD5JPakbVfftRXABGt5/Rscw= -go.opentelemetry.io/otel/trace v1.27.0/go.mod h1:6RiD1hkAprV4/q+yd2ln1HG9GoPx39SuvvstaLBl+l4= +go.opentelemetry.io/otel/trace v1.28.0 h1:GhQ9cUuQGmNDd5BTCP2dAvv75RdMxEfTmYejp+lkx9g= +go.opentelemetry.io/otel/trace v1.28.0/go.mod h1:jPyXzNPg6da9+38HEwElrQiHlVMTnVfM3/yv2OlIHaI= go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= @@ -854,8 +856,8 @@ google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= -google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= +google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= +google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/examples/service/internal/cli/bind_test.go b/examples/service/internal/cli/bind_test.go index cb098e5a..9887bccf 100644 --- a/examples/service/internal/cli/bind_test.go +++ b/examples/service/internal/cli/bind_test.go @@ -90,7 +90,6 @@ func Test_bind(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { if tt.preBindAddr != "" { l, err := net.Listen("tcp", tt.preBindAddr) diff --git a/examples/service/internal/cli/cli_test.go b/examples/service/internal/cli/cli_test.go index 9e13b0ad..9ff68531 100644 --- a/examples/service/internal/cli/cli_test.go +++ b/examples/service/internal/cli/cli_test.go @@ -88,7 +88,6 @@ func TestNew(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { oldOsArgs := os.Args defer func() { os.Args = oldOsArgs }() diff --git a/examples/service/internal/cli/config_test.go b/examples/service/internal/cli/config_test.go index f8d37ae6..4ec3f665 100644 --- a/examples/service/internal/cli/config_test.go +++ b/examples/service/internal/cli/config_test.go @@ -173,7 +173,6 @@ func Test_appConfig_Validate(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/go.mod b/go.mod index 393861ea..b11b1724 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/aperturerobotics/go-brotli-decoder v0.1.1 github.com/aws/aws-sdk-go-v2 v1.30.1 github.com/aws/aws-sdk-go-v2/config v1.27.23 - github.com/aws/aws-sdk-go-v2/service/s3 v1.57.1 + github.com/aws/aws-sdk-go-v2/service/s3 v1.58.0 github.com/aws/aws-sdk-go-v2/service/sqs v1.34.1 github.com/aws/smithy-go v1.20.3 github.com/confluentinc/confluent-kafka-go v1.9.2 @@ -27,8 +27,8 @@ require ( github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.19.0 github.com/stretchr/testify v1.9.0 - github.com/tecnickcom/farmhash64 v1.9.11 - github.com/tecnickcom/statsd v1.0.10 + github.com/tecnickcom/farmhash64 v1.9.12 + github.com/tecnickcom/statsd v1.0.11 github.com/undefinedlabs/go-mpatch v1.0.7 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.27.0 @@ -123,9 +123,9 @@ require ( go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0 // indirect - go.opentelemetry.io/otel v1.27.0 // indirect - go.opentelemetry.io/otel/metric v1.27.0 // indirect - go.opentelemetry.io/otel/trace v1.27.0 // indirect + go.opentelemetry.io/otel v1.28.0 // indirect + go.opentelemetry.io/otel/metric v1.28.0 // indirect + go.opentelemetry.io/otel/trace v1.28.0 // indirect golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 // indirect golang.org/x/mod v0.18.0 // indirect golang.org/x/oauth2 v0.21.0 // indirect @@ -137,7 +137,7 @@ require ( google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect - google.golang.org/grpc v1.64.0 // indirect + google.golang.org/grpc v1.65.0 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index 04c81823..797c3c27 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,5 @@ +cel.dev/expr v0.15.0 h1:O1jzfJCQBfL5BFoYktaxwIhuttaQPsVWerH9/EEKx0w= +cel.dev/expr v0.15.0/go.mod h1:TRSuuV7DlVCE/uwv5QbAiW/v8l5O8C4eEPHeu7gf7Sg= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.115.0 h1:CnFSK6Xo3lDYRoBKEcAtia6VSC837/ZkJuRduSFnr14= @@ -300,8 +302,8 @@ github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.15 h1:I9zMeF10 github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.15/go.mod h1:9xWJ3Q/S6Ojusz1UIkfycgD1mGirJfLLKqq3LPT7WN8= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.13 h1:Eq2THzHt6P41mpjS2sUzz/3dJYFRqdWZ+vQaEMm98EM= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.13/go.mod h1:FgwTca6puegxgCInYwGjmd4tB9195Dd6LCuA+8MjpWw= -github.com/aws/aws-sdk-go-v2/service/s3 v1.57.1 h1:aHPtNY87GZ214N4rShgIo+5JQz7ICrJ50i17JbueUTw= -github.com/aws/aws-sdk-go-v2/service/s3 v1.57.1/go.mod h1:hdV0NTYd0RwV4FvNKhKUNbPLZoq9CTr/lke+3I7aCAI= +github.com/aws/aws-sdk-go-v2/service/s3 v1.58.0 h1:4rhV0Hn+bf8IAIUphRX1moBcEvKJipCPmswMCl6Q5mw= +github.com/aws/aws-sdk-go-v2/service/s3 v1.58.0/go.mod h1:hdV0NTYd0RwV4FvNKhKUNbPLZoq9CTr/lke+3I7aCAI= github.com/aws/aws-sdk-go-v2/service/sqs v1.34.1 h1:Tp1oKSfWHE8fTz0H+DuD05cXPJ96Z6Rko0W/dAp7wJ0= github.com/aws/aws-sdk-go-v2/service/sqs v1.34.1/go.mod h1:5gGM2xv51W5Hkyr3vj7JTEf/b5oOCb7rXcEVbXrcTAU= github.com/aws/aws-sdk-go-v2/service/sso v1.22.1 h1:p1GahKIjyMDZtiKoIn0/jAj/TkMzfzndDv5+zi2Mhgc= @@ -343,8 +345,8 @@ github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XP github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20240318125728-8a4994d93e50 h1:DBmgJDC9dTfkVyGgipamEh2BpGYxScCH1TOF1LL1cXc= -github.com/cncf/xds/go v0.0.0-20240318125728-8a4994d93e50/go.mod h1:5e1+Vvlzido69INQaVO6d87Qn543Xr6nooe9Kz7oBFM= +github.com/cncf/xds/go v0.0.0-20240423153145-555b57ec207b h1:ga8SEFjZ60pxLcmhnThWgvH2wg8376yUJmPhEH4H3kw= +github.com/cncf/xds/go v0.0.0-20240423153145-555b57ec207b/go.mod h1:W+zGtBO5Y1IgJhy4+A9GOqVhqLpfZi+vwmdNXUehLA8= github.com/confluentinc/confluent-kafka-go v1.9.2 h1:gV/GxhMBUb03tFWkN+7kdhg+zf+QUM+wVkI9zwh770Q= github.com/confluentinc/confluent-kafka-go v1.9.2/go.mod h1:ptXNqsuDfYbAE/LBW6pnwWZElUoWxHoV8E43DCrliyo= github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4= @@ -425,8 +427,8 @@ github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69 github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.2.0 h1:uCdmnmatrKCgMBlM4rMuJZWOkPDqdbZPnrMXDY4gI68= -github.com/golang/glog v1.2.0/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= +github.com/golang/glog v1.2.1 h1:OptwRhECazUx5ix5TTWC3EZhsZEHWcYWY4FQHTIubm4= +github.com/golang/glog v1.2.1/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -771,10 +773,10 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= -github.com/tecnickcom/farmhash64 v1.9.11 h1:BQcdyzrxKujDobiTgeGIiV0Ip3yDV+ZdSAew01vCPIg= -github.com/tecnickcom/farmhash64 v1.9.11/go.mod h1:RvRiToh45tYnFuB+N/oxZ3pBD6uD0ALturs3buEFfGA= -github.com/tecnickcom/statsd v1.0.10 h1:V2CxzAsFx5mUDIso679JTgNp37HXn576NvNNWwAM7lY= -github.com/tecnickcom/statsd v1.0.10/go.mod h1:JNpNj3y4wsg5Y+25AuOw5XUM/1v2GhUEBPZRmWE4Kzo= +github.com/tecnickcom/farmhash64 v1.9.12 h1:leGZ6nk2pk6qXGbZET55ZnasuVTaZP/2hOvXwmUmwzE= +github.com/tecnickcom/farmhash64 v1.9.12/go.mod h1:RvRiToh45tYnFuB+N/oxZ3pBD6uD0ALturs3buEFfGA= +github.com/tecnickcom/statsd v1.0.11 h1:Hc8mj+fneBbrbWLCzzvgpYZffa8sjzilhqCbij1XMhY= +github.com/tecnickcom/statsd v1.0.11/go.mod h1:JNpNj3y4wsg5Y+25AuOw5XUM/1v2GhUEBPZRmWE4Kzo= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926 h1:G3dpKMzFDjgEh2q1Z7zUUtKa8ViPtH+ocF0bE0g00O8= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/undefinedlabs/go-mpatch v1.0.7 h1:943FMskd9oqfbZV0qRVKOUsXQhTLXL0bQTVbQSpzmBs= @@ -806,14 +808,14 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.5 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0/go.mod h1:BMsdeOxN04K0L5FNUBfjFdvwWGNe/rkmSwH4Aelu/X0= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0 h1:9l89oX4ba9kHbBol3Xin3leYJ+252h0zszDtBwyKe2A= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0/go.mod h1:XLZfZboOJWHNKUv7eH0inh0E9VV6eWDFB/9yJyTLPp0= -go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg= -go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ= -go.opentelemetry.io/otel/metric v1.27.0 h1:hvj3vdEKyeCi4YaYfNjv2NUje8FqKqUY8IlF0FxV/ik= -go.opentelemetry.io/otel/metric v1.27.0/go.mod h1:mVFgmRlhljgBiuk/MP/oKylr4hs85GZAylncepAX/ak= +go.opentelemetry.io/otel v1.28.0 h1:/SqNcYk+idO0CxKEUOtKQClMK/MimZihKYMruSMViUo= +go.opentelemetry.io/otel v1.28.0/go.mod h1:q68ijF8Fc8CnMHKyzqL6akLO46ePnjkgfIMIjUIX9z4= +go.opentelemetry.io/otel/metric v1.28.0 h1:f0HGvSl1KRAU1DLgLGFjrwVyismPlnuU6JD6bOeuA5Q= +go.opentelemetry.io/otel/metric v1.28.0/go.mod h1:Fb1eVBFZmLVTMb6PPohq3TO9IIhUisDsbJoL/+uQW4s= go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw= go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg= -go.opentelemetry.io/otel/trace v1.27.0 h1:IqYb813p7cmbHk0a5y6pD5JPakbVfftRXABGt5/Rscw= -go.opentelemetry.io/otel/trace v1.27.0/go.mod h1:6RiD1hkAprV4/q+yd2ln1HG9GoPx39SuvvstaLBl+l4= +go.opentelemetry.io/otel/trace v1.28.0 h1:GhQ9cUuQGmNDd5BTCP2dAvv75RdMxEfTmYejp+lkx9g= +go.opentelemetry.io/otel/trace v1.28.0/go.mod h1:jPyXzNPg6da9+38HEwElrQiHlVMTnVfM3/yv2OlIHaI= go.opentelemetry.io/proto/otlp v0.7.0 h1:rwOQPCuKAKmwGKq2aVNnYIibI6wnV7EvzgfTCzcdGg8= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= @@ -996,8 +998,8 @@ google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= -google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= +google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= +google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/pkg/awsopt/awsopt_test.go b/pkg/awsopt/awsopt_test.go index f9810431..cced6d77 100644 --- a/pkg/awsopt/awsopt_test.go +++ b/pkg/awsopt/awsopt_test.go @@ -109,8 +109,6 @@ func Test_WithRegionFromURL(t *testing.T) { } for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T) { t.Setenv("AWS_REGION", tt.envAWSRegion) t.Setenv("AWS_DEFAULT_REGION", tt.envAWSDefaultregion) @@ -165,8 +163,6 @@ func Test_WithEndpoint(t *testing.T) { } for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/bootstrap/bootstrap_test.go b/pkg/bootstrap/bootstrap_test.go index 6645eed9..056cb1b0 100644 --- a/pkg/bootstrap/bootstrap_test.go +++ b/pkg/bootstrap/bootstrap_test.go @@ -97,7 +97,6 @@ func TestBootstrap(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { // cannot run in parallel because signals are received by all parallel tests var ctx context.Context diff --git a/pkg/bootstrap/config_test.go b/pkg/bootstrap/config_test.go index f38ef3f3..0f7b8166 100644 --- a/pkg/bootstrap/config_test.go +++ b/pkg/bootstrap/config_test.go @@ -85,7 +85,6 @@ func Test_config_validate(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go index 206308d5..a018766f 100644 --- a/pkg/config/config_test.go +++ b/pkg/config/config_test.go @@ -84,7 +84,6 @@ func Test_configureConfigSearchPath(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() ctrl := gomock.NewController(t) @@ -209,7 +208,6 @@ func Test_loadLocalConfig(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -384,7 +382,6 @@ func Test_loadRemoteConfig(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -466,7 +463,6 @@ func Test_loadFromEnvVarSource(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -593,7 +589,6 @@ func Test_loadFromRemoteSource(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() ctrl := gomock.NewController(t) @@ -1008,7 +1003,6 @@ func Test_loadConfig(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() diff --git a/pkg/decint/int64_test.go b/pkg/decint/int64_test.go index c018afc9..8dbd5383 100644 --- a/pkg/decint/int64_test.go +++ b/pkg/decint/int64_test.go @@ -32,7 +32,6 @@ func TestFloatToInt(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -68,7 +67,6 @@ func TestIntToFloat(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -111,7 +109,6 @@ func TestStringToInt(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -149,7 +146,6 @@ func TestIntToString(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/decint/uint64_test.go b/pkg/decint/uint64_test.go index 2281d8ec..63a4d8e8 100644 --- a/pkg/decint/uint64_test.go +++ b/pkg/decint/uint64_test.go @@ -32,7 +32,6 @@ func TestFloatToUint(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -63,7 +62,6 @@ func TestUintToFloat(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -106,7 +104,6 @@ func TestStringToUint(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -139,7 +136,6 @@ func TestUintToString(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/dnscache/dnscache_test.go b/pkg/dnscache/dnscache_test.go index be870384..637ad884 100644 --- a/pkg/dnscache/dnscache_test.go +++ b/pkg/dnscache/dnscache_test.go @@ -219,7 +219,7 @@ func Test_LookupHost_concurrent_slow(t *testing.T) { ret := make(chan retval, nlookup) wg := &sync.WaitGroup{} - for j := 0; j < nlookup; j++ { + for range nlookup { wg.Add(1) go func() { @@ -267,7 +267,7 @@ func Test_LookupHost_concurrent_fast(t *testing.T) { ret := make(chan retval, nlookup) wg := &sync.WaitGroup{} - for j := 0; j < nlookup; j++ { + for range nlookup { wg.Add(1) go func() { @@ -322,7 +322,7 @@ func Test_LookupHost_error(t *testing.T) { ret := make(chan retval, nlookup) wg := &sync.WaitGroup{} - for j := 0; j < nlookup; j++ { + for range nlookup { wg.Add(1) go func() { @@ -366,7 +366,7 @@ func Test_LookupHost_error_concurrent_fast(t *testing.T) { ret := make(chan retval, nlookup) wg := &sync.WaitGroup{} - for j := 0; j < nlookup; j++ { + for range nlookup { wg.Add(1) go func() { diff --git a/pkg/encode/encode_test.go b/pkg/encode/encode_test.go index a0b536ce..6bfda883 100644 --- a/pkg/encode/encode_test.go +++ b/pkg/encode/encode_test.go @@ -33,7 +33,6 @@ func Test_base64Encoder(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -90,7 +89,6 @@ func Test_gobEncode(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -137,7 +135,6 @@ func Test_jsonEncode(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -202,7 +199,6 @@ func TestEncode(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -254,8 +250,6 @@ func TestDecode(t *testing.T) { } for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -310,7 +304,6 @@ func TestEncodeDecode(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -354,7 +347,6 @@ func TestByteEncodeDecode(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -427,7 +419,6 @@ func TestSerialize(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -479,8 +470,6 @@ func TestDeserialize(t *testing.T) { } for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -535,7 +524,6 @@ func TestSerializeDeserialize(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -579,7 +567,6 @@ func TestByteSerializeDeserialize(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/encrypt/encrypt_test.go b/pkg/encrypt/encrypt_test.go index c9fc7d1d..ff60fc5d 100644 --- a/pkg/encrypt/encrypt_test.go +++ b/pkg/encrypt/encrypt_test.go @@ -70,7 +70,6 @@ func TestEncryptDecrypt(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -125,7 +124,6 @@ func TestDecryptErrors(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -185,7 +183,6 @@ func Test_ByteEncryptAny_ByteDecryptAny(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -262,7 +259,6 @@ func TestByteDecryptAny_Errors(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -322,7 +318,6 @@ func Test_EncryptAny_DecryptAny(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -396,7 +391,6 @@ func Test_ByteEncryptSerializeAny_ByteDecryptSerializeAny(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -473,7 +467,6 @@ func TestByteDecryptSerializeAny_Errors(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -533,7 +526,6 @@ func Test_EncryptSerializeAny_DecryptSerializeAny(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/enumbitmap/enumbitmap_test.go b/pkg/enumbitmap/enumbitmap_test.go index e73fe3c4..fd37bbf4 100644 --- a/pkg/enumbitmap/enumbitmap_test.go +++ b/pkg/enumbitmap/enumbitmap_test.go @@ -86,7 +86,6 @@ func Test_BitMapToStrings(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -157,7 +156,6 @@ func Test_StringsToBitMap(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/enumdb/enumdb_test.go b/pkg/enumdb/enumdb_test.go index 67d3dd63..d8d801cf 100644 --- a/pkg/enumdb/enumdb_test.go +++ b/pkg/enumdb/enumdb_test.go @@ -88,7 +88,6 @@ func TestNew(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/filter/evaluate_contains_test.go b/pkg/filter/evaluate_contains_test.go index a527c343..34260593 100644 --- a/pkg/filter/evaluate_contains_test.go +++ b/pkg/filter/evaluate_contains_test.go @@ -54,7 +54,6 @@ func TestContains_Evaluate(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/filter/evaluate_equal_test.go b/pkg/filter/evaluate_equal_test.go index 86258bbc..e3c1c927 100644 --- a/pkg/filter/evaluate_equal_test.go +++ b/pkg/filter/evaluate_equal_test.go @@ -162,7 +162,6 @@ func TestEqual_Evaluate(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/filter/evaluate_equalfold_test.go b/pkg/filter/evaluate_equalfold_test.go index 4628f4dc..870d561e 100644 --- a/pkg/filter/evaluate_equalfold_test.go +++ b/pkg/filter/evaluate_equalfold_test.go @@ -150,7 +150,6 @@ func TestEqualFold_Evaluate(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/filter/evaluate_gt_test.go b/pkg/filter/evaluate_gt_test.go index ba908603..6c0124cf 100644 --- a/pkg/filter/evaluate_gt_test.go +++ b/pkg/filter/evaluate_gt_test.go @@ -124,7 +124,6 @@ func TestGT_Evaluate(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/filter/evaluate_gte_test.go b/pkg/filter/evaluate_gte_test.go index 91a53d55..01eec980 100644 --- a/pkg/filter/evaluate_gte_test.go +++ b/pkg/filter/evaluate_gte_test.go @@ -124,7 +124,6 @@ func TestGTE_Evaluate(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/filter/evaluate_hasprefix_test.go b/pkg/filter/evaluate_hasprefix_test.go index a55c6a50..b570dd67 100644 --- a/pkg/filter/evaluate_hasprefix_test.go +++ b/pkg/filter/evaluate_hasprefix_test.go @@ -68,7 +68,6 @@ func TestHasPrefix_Evaluate(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/filter/evaluate_hassuffix_test.go b/pkg/filter/evaluate_hassuffix_test.go index 002ea7c9..6bc55fe0 100644 --- a/pkg/filter/evaluate_hassuffix_test.go +++ b/pkg/filter/evaluate_hassuffix_test.go @@ -68,7 +68,6 @@ func TestHasSuffix_Evaluate(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/filter/evaluate_lt_test.go b/pkg/filter/evaluate_lt_test.go index fe5b8879..bfdaeb39 100644 --- a/pkg/filter/evaluate_lt_test.go +++ b/pkg/filter/evaluate_lt_test.go @@ -124,7 +124,6 @@ func TestLT_Evaluate(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/filter/evaluate_lte_test.go b/pkg/filter/evaluate_lte_test.go index 3d6694c8..dc5faa56 100644 --- a/pkg/filter/evaluate_lte_test.go +++ b/pkg/filter/evaluate_lte_test.go @@ -124,7 +124,6 @@ func TestLTE_Evaluate(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/filter/evaluate_not_test.go b/pkg/filter/evaluate_not_test.go index 060b0a09..d9785044 100644 --- a/pkg/filter/evaluate_not_test.go +++ b/pkg/filter/evaluate_not_test.go @@ -33,7 +33,6 @@ func TestNot_Evaluate(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/filter/evaluate_regexp_test.go b/pkg/filter/evaluate_regexp_test.go index 99723d5b..e1d8391c 100644 --- a/pkg/filter/evaluate_regexp_test.go +++ b/pkg/filter/evaluate_regexp_test.go @@ -68,7 +68,6 @@ func TestRegexp_Evaluate(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/filter/filter.go b/pkg/filter/filter.go index 826304b2..9bb1dae7 100644 --- a/pkg/filter/filter.go +++ b/pkg/filter/filter.go @@ -211,7 +211,7 @@ func (p *Processor) filterSliceValue(slice reflect.Value, offset uint, length in m uint ) - for i := 0; i < slice.Len(); i++ { + for i := range slice.Len() { value := slice.Index(i) // value can always be Interface() because it's in a slice and cannot point to an unexported field diff --git a/pkg/filter/filter_test.go b/pkg/filter/filter_test.go index f8ca42a7..4ab9f62b 100644 --- a/pkg/filter/filter_test.go +++ b/pkg/filter/filter_test.go @@ -61,7 +61,6 @@ func TestParseJSON(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -106,7 +105,6 @@ func TestNew(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -175,7 +173,6 @@ func TestFilter_ParseURLQuery(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -1011,7 +1008,6 @@ func TestFilter_Apply(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -1117,7 +1113,6 @@ func TestFilter_ApplySubset(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -1155,7 +1150,7 @@ func benchmarkFilterApply(b *testing.B, n int, json string, opts ...Option) { require.NoError(b, err) data := make([]simpleStruct, n) - for i := 0; i < n; i++ { + for i := range n { data[i] = simpleStruct{ StringField: "hello world", } diff --git a/pkg/filter/options_test.go b/pkg/filter/options_test.go index 5f024abd..7f7a93cc 100644 --- a/pkg/filter/options_test.go +++ b/pkg/filter/options_test.go @@ -27,7 +27,6 @@ func TestWithFieldNameTag(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -64,7 +63,6 @@ func TestWithQueryFilterKey(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -106,7 +104,6 @@ func TestWithMaxRules(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -148,7 +145,6 @@ func TestWithMaxResults(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/healthcheck/checks_test.go b/pkg/healthcheck/checks_test.go index 6a067034..ef916b47 100644 --- a/pkg/healthcheck/checks_test.go +++ b/pkg/healthcheck/checks_test.go @@ -94,7 +94,6 @@ func TestCheckHttpStatus(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/healthcheck/handler.go b/pkg/healthcheck/handler.go index fad0d406..403e8278 100644 --- a/pkg/healthcheck/handler.go +++ b/pkg/healthcheck/handler.go @@ -53,8 +53,6 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { wg.Add(h.checksCount) for _, hc := range h.checks { - hc := hc - go func() { //nolint:contextcheck defer wg.Done() diff --git a/pkg/healthcheck/handler_test.go b/pkg/healthcheck/handler_test.go index e5efebe3..deb249b6 100644 --- a/pkg/healthcheck/handler_test.go +++ b/pkg/healthcheck/handler_test.go @@ -90,7 +90,6 @@ func TestHandler_ServeHTTP(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/httpclient/client_test.go b/pkg/httpclient/client_test.go index 1c1a41f0..55d79ef8 100644 --- a/pkg/httpclient/client_test.go +++ b/pkg/httpclient/client_test.go @@ -43,7 +43,7 @@ func TestClient_Do(t *testing.T) { bodyStr := `TEST BODY OK` body := make([]byte, 0) - for i := 0; i < 100; i++ { + for range 100 { body = append(body, []byte(bodyStr+`\n`)...) } @@ -94,7 +94,6 @@ func TestClient_Do(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/httpretrier/httpretrier_test.go b/pkg/httpretrier/httpretrier_test.go index ba600663..8d37049d 100644 --- a/pkg/httpretrier/httpretrier_test.go +++ b/pkg/httpretrier/httpretrier_test.go @@ -59,7 +59,6 @@ func TestNew(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -99,7 +98,6 @@ func Test_defaultRetryIf(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -152,7 +150,6 @@ func TestRetryIfForWriteRequests(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -257,7 +254,6 @@ func TestRetryIfForReadRequests(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -369,7 +365,6 @@ func TestHTTPRetrier_Do(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/httpreverseproxy/client_test.go b/pkg/httpreverseproxy/client_test.go index 00880797..a1509f64 100644 --- a/pkg/httpreverseproxy/client_test.go +++ b/pkg/httpreverseproxy/client_test.go @@ -55,7 +55,6 @@ func TestNew(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -150,7 +149,6 @@ func TestClient_ForwardRequest(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/httpserver/config_test.go b/pkg/httpserver/config_test.go index 8552f2e4..8d84cc14 100644 --- a/pkg/httpserver/config_test.go +++ b/pkg/httpserver/config_test.go @@ -76,7 +76,6 @@ func Test_validateAddr(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -111,7 +110,6 @@ func Test_config_isIndexRouteEnabled(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -175,7 +173,6 @@ func Test_setRouter(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/httpserver/httpserver_test.go b/pkg/httpserver/httpserver_test.go index 2a171335..712467b7 100644 --- a/pkg/httpserver/httpserver_test.go +++ b/pkg/httpserver/httpserver_test.go @@ -96,7 +96,6 @@ func Test_defaultIPHandler(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -388,7 +387,6 @@ YlAqGKDZ+A+l } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/httpserver/options_test.go b/pkg/httpserver/options_test.go index 3bbfac27..0b135a2b 100644 --- a/pkg/httpserver/options_test.go +++ b/pkg/httpserver/options_test.go @@ -187,7 +187,6 @@ YlAqGKDZ+A+l } for _, tt := range tests { - tt := tt t.Run(tt.desc, func(t *testing.T) { t.Parallel() diff --git a/pkg/httputil/jsendx/deprecated_test.go b/pkg/httputil/jsendx/deprecated_test.go index dbce1ebd..0d2a6a51 100644 --- a/pkg/httputil/jsendx/deprecated_test.go +++ b/pkg/httputil/jsendx/deprecated_test.go @@ -52,7 +52,6 @@ func TestNewRouter(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/httputil/jsendx/jsendx_test.go b/pkg/httputil/jsendx/jsendx_test.go index 96bdb288..a5651c80 100644 --- a/pkg/httputil/jsendx/jsendx_test.go +++ b/pkg/httputil/jsendx/jsendx_test.go @@ -228,7 +228,6 @@ func TestDefaultIPHandler(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/httputil/link_test.go b/pkg/httputil/link_test.go index 463831af..c54c3818 100644 --- a/pkg/httputil/link_test.go +++ b/pkg/httputil/link_test.go @@ -51,7 +51,6 @@ func TestLink(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/httputil/request_test.go b/pkg/httputil/request_test.go index 99c35455..01626c89 100644 --- a/pkg/httputil/request_test.go +++ b/pkg/httputil/request_test.go @@ -52,7 +52,6 @@ func TestPathParam(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -87,12 +86,12 @@ func TestHeaderOrDefault(t *testing.T) { r, err := http.NewRequestWithContext(ctx, http.MethodGet, "/", nil) require.NoError(t, err) - r.Header.Add("set-header", "test") + r.Header.Add("Set-Header", "test") - v1 := HeaderOrDefault(r, "unset-header", "default") + v1 := HeaderOrDefault(r, "Unset-Header", "default") require.Equal(t, "default", v1) - v2 := HeaderOrDefault(r, "set-header", "default") + v2 := HeaderOrDefault(r, "Set-Header", "default") require.Equal(t, "test", v2) } @@ -142,7 +141,6 @@ func TestQueryStringOrDefault(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -207,7 +205,6 @@ func TestQueryIntOrDefault(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -272,7 +269,6 @@ func TestQueryUintOrDefault(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/httputil/response_test.go b/pkg/httputil/response_test.go index bcf41cd4..f87bf830 100644 --- a/pkg/httputil/response_test.go +++ b/pkg/httputil/response_test.go @@ -40,7 +40,6 @@ func TestStatus_MarshalJSON(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/ipify/client_test.go b/pkg/ipify/client_test.go index 2c2fbc2a..bb03de59 100644 --- a/pkg/ipify/client_test.go +++ b/pkg/ipify/client_test.go @@ -50,7 +50,6 @@ func TestNew(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -117,7 +116,6 @@ func TestClient_GetPublicIP(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/jwt/jwt_test.go b/pkg/jwt/jwt_test.go index 140ef604..bdecf265 100644 --- a/pkg/jwt/jwt_test.go +++ b/pkg/jwt/jwt_test.go @@ -55,7 +55,6 @@ func TestNew(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -136,7 +135,6 @@ func TestLoginHandler(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -225,7 +223,6 @@ func TestRenewHandler(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -319,7 +316,6 @@ func TestIsAuthorized(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/kafka/consumer_test.go b/pkg/kafka/consumer_test.go index ca361b81..f528836c 100644 --- a/pkg/kafka/consumer_test.go +++ b/pkg/kafka/consumer_test.go @@ -52,8 +52,6 @@ func Test_NewConsumer(t *testing.T) { } for _, tt := range testCases { - tt := tt - t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -226,8 +224,6 @@ func TestReceiveData(t *testing.T) { } for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/kafka/producer_test.go b/pkg/kafka/producer_test.go index b7bf888d..6698fbaf 100644 --- a/pkg/kafka/producer_test.go +++ b/pkg/kafka/producer_test.go @@ -42,8 +42,6 @@ func Test_NewProducer(t *testing.T) { } for _, tt := range testCases { - tt := tt - t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/kafkacgo/consumer_test.go b/pkg/kafkacgo/consumer_test.go index 1cb0d7eb..4789ad6d 100644 --- a/pkg/kafkacgo/consumer_test.go +++ b/pkg/kafkacgo/consumer_test.go @@ -68,8 +68,6 @@ func Test_NewConsumer(t *testing.T) { } for _, tt := range testCases { - tt := tt - t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -219,8 +217,6 @@ func TestReceiveData(t *testing.T) { } for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/kafkacgo/producer_test.go b/pkg/kafkacgo/producer_test.go index 2a6c8ec5..38619b3f 100644 --- a/pkg/kafkacgo/producer_test.go +++ b/pkg/kafkacgo/producer_test.go @@ -56,8 +56,6 @@ func Test_NewProducer(t *testing.T) { } for _, tt := range testCases { - tt := tt - t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/logging/format_test.go b/pkg/logging/format_test.go index 2915d17f..d40c50bb 100644 --- a/pkg/logging/format_test.go +++ b/pkg/logging/format_test.go @@ -35,7 +35,6 @@ func TestParseFormat(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/logging/level_test.go b/pkg/logging/level_test.go index c131fecb..5ad17206 100644 --- a/pkg/logging/level_test.go +++ b/pkg/logging/level_test.go @@ -90,7 +90,6 @@ func TestParseLevel(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/logging/logging_test.go b/pkg/logging/logging_test.go index d2b52959..9c1b5984 100644 --- a/pkg/logging/logging_test.go +++ b/pkg/logging/logging_test.go @@ -59,7 +59,6 @@ func TestNewLogger(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/logging/options_test.go b/pkg/logging/options_test.go index 30492884..d8c870a1 100644 --- a/pkg/logging/options_test.go +++ b/pkg/logging/options_test.go @@ -71,7 +71,6 @@ func TestWithFormatStr(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -104,7 +103,6 @@ func TestWithLevelStr(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/metrics/prometheus/client_test.go b/pkg/metrics/prometheus/client_test.go index 3054b447..314a9c3b 100644 --- a/pkg/metrics/prometheus/client_test.go +++ b/pkg/metrics/prometheus/client_test.go @@ -61,7 +61,6 @@ func TestNew(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/metrics/statsd/client_test.go b/pkg/metrics/statsd/client_test.go index d8e0367a..fc266b1d 100644 --- a/pkg/metrics/statsd/client_test.go +++ b/pkg/metrics/statsd/client_test.go @@ -53,7 +53,6 @@ func TestNew(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/mysqllock/mysqllock_test.go b/pkg/mysqllock/mysqllock_test.go index eb0576f8..7a3f1f94 100644 --- a/pkg/mysqllock/mysqllock_test.go +++ b/pkg/mysqllock/mysqllock_test.go @@ -79,7 +79,6 @@ func TestDB_Acquire(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -178,7 +177,6 @@ func Test_keepConnectionAlive(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/paging/paging_test.go b/pkg/paging/paging_test.go index 75d0567f..d38fdba3 100644 --- a/pkg/paging/paging_test.go +++ b/pkg/paging/paging_test.go @@ -142,7 +142,6 @@ func TestNew(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -242,7 +241,6 @@ func TestComputeOffsetAndLimit(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/passwordpwned/client_test.go b/pkg/passwordpwned/client_test.go index 46a02654..ee4419f7 100644 --- a/pkg/passwordpwned/client_test.go +++ b/pkg/passwordpwned/client_test.go @@ -27,7 +27,6 @@ func TestNew(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/passwordpwned/passwordpwned.go b/pkg/passwordpwned/passwordpwned.go index d72ce03b..0a5b550e 100644 --- a/pkg/passwordpwned/passwordpwned.go +++ b/pkg/passwordpwned/passwordpwned.go @@ -35,7 +35,7 @@ func (c *Client) IsPwnedPassword(ctx context.Context, password string) (bool, er return false, fmt.Errorf("create request: %w", err) } - r.Header.Set("user-agent", c.userAgent) + r.Header.Set("User-Agent", c.userAgent) r.Header.Set("Accept-Encoding", "br") // Responses are brotli-encoded. r.Header.Set("Add-Padding", "true") // All responses will contain between 800 and 1,000 results regardless of the number of hash suffixes returned by the service. diff --git a/pkg/passwordpwned/passwordpwned_test.go b/pkg/passwordpwned/passwordpwned_test.go index f9008af4..2fed6566 100644 --- a/pkg/passwordpwned/passwordpwned_test.go +++ b/pkg/passwordpwned/passwordpwned_test.go @@ -174,7 +174,6 @@ func TestClient_IsPwnedPassword(t *testing.T) { //nolint:paralleltest for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() diff --git a/pkg/periodic/periodic_test.go b/pkg/periodic/periodic_test.go index 7fe5b6a7..99826403 100644 --- a/pkg/periodic/periodic_test.go +++ b/pkg/periodic/periodic_test.go @@ -78,7 +78,6 @@ func TestNew(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/profiling/profiling_test.go b/pkg/profiling/profiling_test.go index f19e06a7..edf5186b 100644 --- a/pkg/profiling/profiling_test.go +++ b/pkg/profiling/profiling_test.go @@ -45,7 +45,6 @@ func TestPProfHandler(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/retrier/retrier_test.go b/pkg/retrier/retrier_test.go index d9aee880..1d44f10d 100644 --- a/pkg/retrier/retrier_test.go +++ b/pkg/retrier/retrier_test.go @@ -41,7 +41,6 @@ func TestNew(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -107,7 +106,6 @@ func TestRetrier_Run(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -155,7 +153,6 @@ func TestDefaultRetryIf(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/s3/client_test.go b/pkg/s3/client_test.go index 720a9591..0d67716a 100644 --- a/pkg/s3/client_test.go +++ b/pkg/s3/client_test.go @@ -101,8 +101,6 @@ func TestS3Client_DeleteObject(t *testing.T) { }, } for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -164,8 +162,6 @@ func TestS3Client_GetObject(t *testing.T) { }, } for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -248,8 +244,6 @@ func TestS3Client_ListObject(t *testing.T) { }, } for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -303,8 +297,6 @@ func TestS3Client_PutObject(t *testing.T) { }, } for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/s3/options_test.go b/pkg/s3/options_test.go index 8959816f..d170fee9 100644 --- a/pkg/s3/options_test.go +++ b/pkg/s3/options_test.go @@ -74,8 +74,6 @@ func Test_ResolveEndpoint(t *testing.T) { } for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/slack/client_test.go b/pkg/slack/client_test.go index 392be12c..4d854ad3 100644 --- a/pkg/slack/client_test.go +++ b/pkg/slack/client_test.go @@ -44,7 +44,6 @@ func TestNew(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -138,7 +137,6 @@ func TestClient_HealthCheck(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -261,7 +259,6 @@ func TestClient_Send(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/sleuth/client_test.go b/pkg/sleuth/client_test.go index 2af6cbb3..449d3916 100644 --- a/pkg/sleuth/client_test.go +++ b/pkg/sleuth/client_test.go @@ -64,7 +64,6 @@ func TestNew(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -148,8 +147,6 @@ func TestClient_HealthCheck(t *testing.T) { } for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -241,8 +238,6 @@ func Test_httpRequest(t *testing.T) { } for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/sleuth/sleuth_test.go b/pkg/sleuth/sleuth_test.go index 602b7bb7..e6621eaa 100644 --- a/pkg/sleuth/sleuth_test.go +++ b/pkg/sleuth/sleuth_test.go @@ -113,8 +113,6 @@ func Test_sendRequest(t *testing.T) { } for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() @@ -241,8 +239,6 @@ func TestClient_SendDeployRegistration(t *testing.T) { } for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -315,8 +311,6 @@ func TestClient_SendManualChange(t *testing.T) { } for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -388,8 +382,6 @@ func TestClient_SendCustomIncidentImpactRegistration(t *testing.T) { } for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -452,8 +444,6 @@ func TestClient_SendCustomMetricImpactRegistration(t *testing.T) { } for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/sliceutil/stats_test.go b/pkg/sliceutil/stats_test.go index 9b976930..8a8224ba 100644 --- a/pkg/sliceutil/stats_test.go +++ b/pkg/sliceutil/stats_test.go @@ -79,8 +79,6 @@ func TestStats(t *testing.T) { } for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/sqlconn/config_test.go b/pkg/sqlconn/config_test.go index 0f66b298..a42836ff 100644 --- a/pkg/sqlconn/config_test.go +++ b/pkg/sqlconn/config_test.go @@ -125,7 +125,6 @@ func Test_config_validate(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/sqlconn/sqlconn_test.go b/pkg/sqlconn/sqlconn_test.go index dd86f3ef..ecab4058 100644 --- a/pkg/sqlconn/sqlconn_test.go +++ b/pkg/sqlconn/sqlconn_test.go @@ -76,7 +76,6 @@ func TestConnect(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -187,7 +186,6 @@ func TestSQLConn_HealthCheck(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -257,7 +255,6 @@ func Test_checkConnection(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -327,7 +324,6 @@ func Test_connectWithBackoff(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -393,7 +389,6 @@ func Test_parseConnectionURL(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/sqltransaction/sqltransaction_test.go b/pkg/sqltransaction/sqltransaction_test.go index ac546fce..3aa38bb0 100644 --- a/pkg/sqltransaction/sqltransaction_test.go +++ b/pkg/sqltransaction/sqltransaction_test.go @@ -77,7 +77,6 @@ func Test_Exec(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -133,7 +132,6 @@ func Test_ExecWithOptions(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/sqlutil/sqlinclause_test.go b/pkg/sqlutil/sqlinclause_test.go index 296bb1d9..14a6326b 100644 --- a/pkg/sqlutil/sqlinclause_test.go +++ b/pkg/sqlutil/sqlinclause_test.go @@ -42,7 +42,6 @@ func TestBuildInClauseString(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -90,7 +89,6 @@ func TestBuildNotInClauseString(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -138,7 +136,6 @@ func TestBuildInClauseInt(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -186,7 +183,6 @@ func TestBuildNotInClauseInt(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -234,7 +230,6 @@ func TestBuildInClauseUint(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -282,7 +277,6 @@ func TestBuildNotInClauseUint(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/sqlutil/sqlutil.go b/pkg/sqlutil/sqlutil.go index d6a0d70f..358bef32 100644 --- a/pkg/sqlutil/sqlutil.go +++ b/pkg/sqlutil/sqlutil.go @@ -87,7 +87,7 @@ func defaultQuoteValue(s string) string { func escape(s string) string { dest := make([]byte, 0, 2*len(s)) - for i := 0; i < len(s); i++ { + for i := range len(s) { c := s[i] switch c { diff --git a/pkg/sqlutil/sqlutil_test.go b/pkg/sqlutil/sqlutil_test.go index ae75dd9a..5eaefcb1 100644 --- a/pkg/sqlutil/sqlutil_test.go +++ b/pkg/sqlutil/sqlutil_test.go @@ -31,7 +31,6 @@ func TestNew(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -87,7 +86,6 @@ func Test_validate(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -149,7 +147,6 @@ func Test_defaultQuoteID(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -201,7 +198,6 @@ func Test_defaultQuoteValue(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/sqlxtransaction/sqlxtransaction_test.go b/pkg/sqlxtransaction/sqlxtransaction_test.go index 39646cd9..303b070f 100644 --- a/pkg/sqlxtransaction/sqlxtransaction_test.go +++ b/pkg/sqlxtransaction/sqlxtransaction_test.go @@ -78,7 +78,6 @@ func Test_Exec(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -137,7 +136,6 @@ func Test_ExecWithOptions(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/sqs/client_test.go b/pkg/sqs/client_test.go index cc784e8f..c698872c 100644 --- a/pkg/sqs/client_test.go +++ b/pkg/sqs/client_test.go @@ -141,8 +141,6 @@ func TestSend(t *testing.T) { } for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -210,8 +208,6 @@ func TestReceive(t *testing.T) { } for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -270,8 +266,6 @@ func TestDelete(t *testing.T) { } for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -382,8 +376,6 @@ func TestReceiveData(t *testing.T) { } for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -448,8 +440,6 @@ func TestHealthCheck(t *testing.T) { } for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/sqs/options_test.go b/pkg/sqs/options_test.go index 9db6e14a..023b7abd 100644 --- a/pkg/sqs/options_test.go +++ b/pkg/sqs/options_test.go @@ -74,8 +74,6 @@ func Test_ResolveEndpoint(t *testing.T) { } for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/stringkey/stringkey_test.go b/pkg/stringkey/stringkey_test.go index eeb9a1d0..30838dd4 100644 --- a/pkg/stringkey/stringkey_test.go +++ b/pkg/stringkey/stringkey_test.go @@ -56,8 +56,6 @@ func TestNew(t *testing.T) { t.Parallel() for _, tt := range getTestData() { - tt := tt - t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/stringmetric/stringmetric.go b/pkg/stringmetric/stringmetric.go index bbc7fb78..6b463f85 100644 --- a/pkg/stringmetric/stringmetric.go +++ b/pkg/stringmetric/stringmetric.go @@ -113,7 +113,7 @@ func initDLAlphabet(ra, rb []rune, maxdist int) map[rune]int { func initDLMatrix(ncols, nrows, maxdist int) [][]int { dist := make([][]int, ncols) - for i := 0; i < ncols; i++ { + for i := range ncols { dist[i] = make([]int, nrows) dist[i][0] = maxdist dist[i][1] = i - 1 diff --git a/pkg/stringmetric/stringmetric_test.go b/pkg/stringmetric/stringmetric_test.go index 13fcfb0c..8d1814dd 100644 --- a/pkg/stringmetric/stringmetric_test.go +++ b/pkg/stringmetric/stringmetric_test.go @@ -102,8 +102,6 @@ func TestDLDistance(t *testing.T) { } for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/threadsafe/tsslice/example_tsslice_test.go b/pkg/threadsafe/tsslice/example_tsslice_test.go index 5afec8ca..ca19c4cb 100644 --- a/pkg/threadsafe/tsslice/example_tsslice_test.go +++ b/pkg/threadsafe/tsslice/example_tsslice_test.go @@ -87,7 +87,7 @@ func ExampleAppend_concurrent() { max := 5 s := make([]int, 0, max) - for i := 0; i < max; i++ { + for i := range max { wg.Add(1) go func(item int) { diff --git a/pkg/threadsafe/tsslice/tsslice_test.go b/pkg/threadsafe/tsslice/tsslice_test.go index ff327d2b..105b20f8 100644 --- a/pkg/threadsafe/tsslice/tsslice_test.go +++ b/pkg/threadsafe/tsslice/tsslice_test.go @@ -83,7 +83,7 @@ func TestAppend_concurrent(t *testing.T) { max := 5 s := make([]int, 0, max) - for i := 0; i < max; i++ { + for i := range max { wg.Add(1) go func(item int) { diff --git a/pkg/timeutil/duration_test.go b/pkg/timeutil/duration_test.go index 4e67f8ad..8d6d0be9 100644 --- a/pkg/timeutil/duration_test.go +++ b/pkg/timeutil/duration_test.go @@ -34,7 +34,6 @@ func TestDuration_MarshalJSON(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -75,7 +74,6 @@ func Test_json_Marshal(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -148,7 +146,6 @@ func TestDuration_UnmarshalJSON(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -227,7 +224,6 @@ func Test_json_Unmarshal(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/traceid/traceid_test.go b/pkg/traceid/traceid_test.go index 83b895bb..26116f3e 100644 --- a/pkg/traceid/traceid_test.go +++ b/pkg/traceid/traceid_test.go @@ -99,7 +99,6 @@ func TestFromHTTPRequestHeader(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/typeutil/typeutil_test.go b/pkg/typeutil/typeutil_test.go index 382202fc..2ccc3dcc 100644 --- a/pkg/typeutil/typeutil_test.go +++ b/pkg/typeutil/typeutil_test.go @@ -202,7 +202,6 @@ func TestPointer(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -243,7 +242,6 @@ func TestValue(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/uid/uid_test.go b/pkg/uid/uid_test.go index 0908579e..f7748418 100644 --- a/pkg/uid/uid_test.go +++ b/pkg/uid/uid_test.go @@ -51,11 +51,11 @@ func collisionTest(t *testing.T, f func() string, concurrency, iterations int) { genWg := &sync.WaitGroup{} genWg.Add(concurrency) - for i := 0; i < concurrency; i++ { + for range concurrency { go func() { defer genWg.Done() - for i := 0; i < iterations; i++ { + for range iterations { idCh <- f() } }() @@ -66,7 +66,7 @@ func collisionTest(t *testing.T, f func() string, concurrency, iterations int) { ids := make(map[string]bool, total) - for i := 0; i < total; i++ { + for range total { id, ok := <-idCh if !ok { t.Errorf("unexpected closed id channel") diff --git a/pkg/uidc/uidc_test.go b/pkg/uidc/uidc_test.go index a1e0c3e0..cbffeee4 100644 --- a/pkg/uidc/uidc_test.go +++ b/pkg/uidc/uidc_test.go @@ -51,11 +51,11 @@ func collisionTest(t *testing.T, f func() string, concurrency, iterations int) { genWg := &sync.WaitGroup{} genWg.Add(concurrency) - for i := 0; i < concurrency; i++ { + for range concurrency { go func() { defer genWg.Done() - for i := 0; i < iterations; i++ { + for range iterations { idCh <- f() } }() @@ -66,7 +66,7 @@ func collisionTest(t *testing.T, f func() string, concurrency, iterations int) { ids := make(map[string]bool, total) - for i := 0; i < total; i++ { + for range total { id, ok := <-idCh if !ok { t.Errorf("unexpected closed id channel") diff --git a/pkg/validator/custom_test.go b/pkg/validator/custom_test.go index 55e2e43f..2cb0ca7c 100644 --- a/pkg/validator/custom_test.go +++ b/pkg/validator/custom_test.go @@ -162,7 +162,6 @@ func TestCustomTags(t *testing.T) { require.NoError(t, err, "New() unexpected error = %v", err) for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/validator/options_test.go b/pkg/validator/options_test.go index 7e392d99..c8c3d805 100644 --- a/pkg/validator/options_test.go +++ b/pkg/validator/options_test.go @@ -28,7 +28,6 @@ func TestWithFieldNameTag(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -65,7 +64,6 @@ func TestWithCustomValidationTags(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -139,7 +137,6 @@ func TestWithErrorTemplates(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/validator/validator_test.go b/pkg/validator/validator_test.go index 51e65008..698c067a 100644 --- a/pkg/validator/validator_test.go +++ b/pkg/validator/validator_test.go @@ -63,7 +63,6 @@ func TestNew(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -158,7 +157,6 @@ func TestValidator_ValidateStruct(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel()