Skip to content

Commit 60dce65

Browse files
committed
chore(lint): pin golang-ci lint version
* do not check ireturn anonymous
1 parent 78ecf16 commit 60dce65

File tree

6 files changed

+10
-7
lines changed

6 files changed

+10
-7
lines changed

.github/workflows/golangci-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ jobs:
1616
uses: golangci/[email protected]
1717
with:
1818
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
19-
version: latest
19+
version: v2.1.6
2020
args: --timeout 5m

.golangci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ linters:
118118
rules:
119119
- name: exported
120120
disabled: true
121+
ireturn:
122+
reject:
123+
- anon
121124

122125
exclusions:
123126
rules:

internal/datasource/search.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99

1010
// FindExact finds the first element in 'slice' matching the condition defined by 'finder'.
1111
// It returns the first matching element and an error if either no match is found or multiple matches are found.
12-
func FindExact[T any](slice []T, finder func(T) bool, searchName string) (T, error) { //nolint
12+
func FindExact[T any](slice []T, finder func(T) bool, searchName string) (T, error) {
1313
var found T
1414

1515
var foundFlag bool

internal/transport/retry.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ func (c *RetryableTransport) RoundTrip(r *http.Request) (*http.Response, error)
111111
return c.Do(req)
112112
}
113113

114-
func RetryOnTransientStateError[T any, U any](action func() (T, error), waiter func() (U, error)) (T, error) { //nolint
114+
func RetryOnTransientStateError[T any, U any](action func() (T, error), waiter func() (U, error)) (T, error) {
115115
t, err := action()
116116

117117
var transientStateError *scw.TransientStateError

internal/transport/retry_aws.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ import (
99
)
1010

1111
// RetryWhenAWSErrCodeEquals retries a function when it returns a specific AWS error
12-
func RetryWhenAWSErrCodeEquals[T any](ctx context.Context, codes []string, config *RetryWhenConfig[T]) (T, error) { //nolint: ireturn
12+
func RetryWhenAWSErrCodeEquals[T any](ctx context.Context, codes []string, config *RetryWhenConfig[T]) (T, error) {
1313
return retryWhen(ctx, config, func(err error) bool {
1414
return tfawserr.ErrCodeEquals(err, codes...)
1515
})
1616
}
1717

1818
// RetryWhenAWSErrCodeNotEquals retries a function until it returns a specific AWS error
19-
func RetryWhenAWSErrCodeNotEquals[T any](ctx context.Context, codes []string, config *RetryWhenConfig[T]) (T, error) { //nolint: ireturn
19+
func RetryWhenAWSErrCodeNotEquals[T any](ctx context.Context, codes []string, config *RetryWhenConfig[T]) (T, error) {
2020
return retryWhen(ctx, config, func(err error) bool {
2121
if err == nil {
2222
return true
@@ -28,7 +28,7 @@ func RetryWhenAWSErrCodeNotEquals[T any](ctx context.Context, codes []string, co
2828

2929
// retryWhen executes the function passed in the configuration object until the timeout is reached or the context is cancelled.
3030
// It will retry if the shouldRetry function returns true. It will stop if the shouldRetry function returns false.
31-
func retryWhen[T any](ctx context.Context, config *RetryWhenConfig[T], shouldRetry func(error) bool) (T, error) { //nolint: ireturn
31+
func retryWhen[T any](ctx context.Context, config *RetryWhenConfig[T], shouldRetry func(error) bool) (T, error) {
3232
retryInterval := config.Interval
3333
if DefaultWaitRetryInterval != nil {
3434
retryInterval = *DefaultWaitRetryInterval

internal/types/map.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func ExpandMapStringString(data any) map[string]string {
7272

7373
// GetMapValue returns the value for a key from a map.
7474
// returns zero value if key does not exist in map.
75-
func GetMapValue[T any]( //nolint:ireturn
75+
func GetMapValue[T any](
7676
m map[string]any,
7777
key string,
7878
) T {

0 commit comments

Comments
 (0)