Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ jobs:
uses: golangci/[email protected]
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: latest
version: v2.1.6
args: --timeout 5m
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ linters:
rules:
- name: exported
disabled: true
ireturn:
reject:
- anon

exclusions:
rules:
Expand Down
2 changes: 1 addition & 1 deletion internal/datasource/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

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

var foundFlag bool
Expand Down
2 changes: 1 addition & 1 deletion internal/transport/retry.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func (c *RetryableTransport) RoundTrip(r *http.Request) (*http.Response, error)
return c.Do(req)
}

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

var transientStateError *scw.TransientStateError
Expand Down
6 changes: 3 additions & 3 deletions internal/transport/retry_aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ import (
)

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

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

// retryWhen executes the function passed in the configuration object until the timeout is reached or the context is cancelled.
// It will retry if the shouldRetry function returns true. It will stop if the shouldRetry function returns false.
func retryWhen[T any](ctx context.Context, config *RetryWhenConfig[T], shouldRetry func(error) bool) (T, error) { //nolint: ireturn
func retryWhen[T any](ctx context.Context, config *RetryWhenConfig[T], shouldRetry func(error) bool) (T, error) {
retryInterval := config.Interval
if DefaultWaitRetryInterval != nil {
retryInterval = *DefaultWaitRetryInterval
Expand Down
2 changes: 1 addition & 1 deletion internal/types/map.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func ExpandMapStringString(data any) map[string]string {

// GetMapValue returns the value for a key from a map.
// returns zero value if key does not exist in map.
func GetMapValue[T any]( //nolint:ireturn
func GetMapValue[T any](
m map[string]any,
key string,
) T {
Expand Down
Loading