Skip to content

Commit 8901b17

Browse files
committed
Replaces interface{} with any
1 parent 9696876 commit 8901b17

File tree

8 files changed

+18
-18
lines changed

8 files changed

+18
-18
lines changed

aws_config_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,7 +1174,7 @@ func cancelRequestMiddleware(t *testing.T, id string, f func(t *testing.T, reque
11741174
})
11751175
}
11761176

1177-
func fullTypeName(i interface{}) string {
1177+
func fullTypeName(i any) string {
11781178
return fullValueTypeName(reflect.ValueOf(i))
11791179
}
11801180

@@ -3806,7 +3806,7 @@ func TestRetryHandlers(t *testing.T) {
38063806

38073807
am := retry.NewAttemptMiddleware(&withNoDelay{
38083808
Retryer: awsConfig.Retryer(),
3809-
}, func(i interface{}) interface{} {
3809+
}, func(i any) any {
38103810
return i
38113811
})
38123812
_, metadata, err := am.HandleFinalize(ctx, middleware.FinalizeInput{Request: nil}, testcase.NextHandler())

endpoints.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
func credentialsEndpointResolver(ctx context.Context, c *Config) aws.EndpointResolverWithOptions {
2020
logger := logging.RetrieveLogger(ctx)
2121

22-
resolver := func(service, region string, options ...interface{}) (aws.Endpoint, error) {
22+
resolver := func(service, region string, options ...any) (aws.Endpoint, error) {
2323
switch service {
2424
case iam.ServiceID:
2525
if endpoint := c.IamEndpoint; endpoint != "" {

internal/awsconfig/resolvers.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ type UseFIPSEndpointProvider interface {
1717
}
1818

1919
// Copied from https://github.com/aws/aws-sdk-go-v2/blob/main/internal/configsources/config.go
20-
func ResolveUseFIPSEndpoint(ctx context.Context, configSources []interface{}) (value aws.FIPSEndpointState, found bool, err error) {
20+
func ResolveUseFIPSEndpoint(ctx context.Context, configSources []any) (value aws.FIPSEndpointState, found bool, err error) {
2121
for _, cfg := range configSources {
2222
if p, ok := cfg.(UseFIPSEndpointProvider); ok {
2323
value, found, err = p.GetUseFIPSEndpoint(ctx)
@@ -47,7 +47,7 @@ type UseDualStackEndpointProvider interface {
4747
}
4848

4949
// Copied from https://github.com/aws/aws-sdk-go-v2/blob/main/internal/configsources/config.go
50-
func ResolveUseDualStackEndpoint(ctx context.Context, configSources []interface{}) (value aws.DualStackEndpointState, found bool, err error) {
50+
func ResolveUseDualStackEndpoint(ctx context.Context, configSources []any) (value aws.DualStackEndpointState, found bool, err error) {
5151
for _, cfg := range configSources {
5252
if p, ok := cfg.(UseDualStackEndpointProvider); ok {
5353
value, found, err = p.GetUseDualStackEndpoint(ctx)
@@ -77,7 +77,7 @@ type EC2IMDSClientEnableStateResolver interface {
7777
}
7878

7979
// Copied and renamed from https://github.com/aws/aws-sdk-go-v2/blob/main/feature/ec2/imds/internal/config/resolvers.go
80-
func ResolveEC2IMDSClientEnableState(sources []interface{}) (value imds.ClientEnableState, found bool, err error) {
80+
func ResolveEC2IMDSClientEnableState(sources []any) (value imds.ClientEnableState, found bool, err error) {
8181
for _, source := range sources {
8282
if resolver, ok := source.(EC2IMDSClientEnableStateResolver); ok {
8383
value, found, err = resolver.GetEC2IMDSClientEnableState()
@@ -107,7 +107,7 @@ type EC2IMDSEndpointResolver interface {
107107
}
108108

109109
// Copied and renamed from https://github.com/aws/aws-sdk-go-v2/blob/main/feature/ec2/imds/internal/config/resolvers.go
110-
func ResolveEC2IMDSEndpointConfig(configSources []interface{}) (value string, found bool, err error) {
110+
func ResolveEC2IMDSEndpointConfig(configSources []any) (value string, found bool, err error) {
111111
for _, cfg := range configSources {
112112
if p, ok := cfg.(EC2IMDSEndpointResolver); ok {
113113
value, found, err = p.GetEC2IMDSEndpoint()
@@ -125,7 +125,7 @@ type EC2IMDSEndpointModeResolver interface {
125125
}
126126

127127
// Copied and renamed from https://github.com/aws/aws-sdk-go-v2/blob/main/feature/ec2/imds/internal/config/resolvers.go
128-
func ResolveEC2IMDSEndpointModeConfig(sources []interface{}) (value imds.EndpointModeState, found bool, err error) {
128+
func ResolveEC2IMDSEndpointModeConfig(sources []any) (value imds.EndpointModeState, found bool, err error) {
129129
for _, source := range sources {
130130
if resolver, ok := source.(EC2IMDSEndpointModeResolver); ok {
131131
value, found, err = resolver.GetEC2IMDSEndpointMode()
@@ -155,7 +155,7 @@ type RetryMaxAttemptsProvider interface {
155155
}
156156

157157
// Copied and renamed from https://github.com/aws/aws-sdk-go-v2/blob/main/config/provider.go
158-
func GetRetryMaxAttempts(ctx context.Context, sources []interface{}) (v int, found bool, err error) {
158+
func GetRetryMaxAttempts(ctx context.Context, sources []any) (v int, found bool, err error) {
159159
for _, c := range sources {
160160
if p, ok := c.(RetryMaxAttemptsProvider); ok {
161161
v, found, err = p.GetRetryMaxAttempts(ctx)

internal/generate/common/generator.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,24 @@ func NewGenerator() *Generator {
2626
return &Generator{}
2727
}
2828

29-
func (g *Generator) Infof(format string, a ...interface{}) {
29+
func (g *Generator) Infof(format string, a ...any) {
3030
g.output(os.Stdout, format, a...)
3131
}
3232

33-
func (g *Generator) Warnf(format string, a ...interface{}) {
33+
func (g *Generator) Warnf(format string, a ...any) {
3434
g.Errorf(format, a...)
3535
}
3636

37-
func (g *Generator) Errorf(format string, a ...interface{}) {
37+
func (g *Generator) Errorf(format string, a ...any) {
3838
g.output(os.Stderr, format, a...)
3939
}
4040

41-
func (g *Generator) Fatalf(format string, a ...interface{}) {
41+
func (g *Generator) Fatalf(format string, a ...any) {
4242
g.Errorf(format, a...)
4343
os.Exit(1)
4444
}
4545

46-
func (g *Generator) output(w io.Writer, format string, a ...interface{}) {
46+
func (g *Generator) output(w io.Writer, format string, a ...any) {
4747
fmt.Fprintf(w, format, a...)
4848
fmt.Fprint(w, "\n")
4949
}

logger.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ type debugLogger struct {
3535
ctx context.Context
3636
}
3737

38-
func (l debugLogger) Logf(classification smithylogging.Classification, format string, v ...interface{}) {
38+
func (l debugLogger) Logf(classification smithylogging.Classification, format string, v ...any) {
3939
s := fmt.Sprintf(format, v...)
4040
if l.ctx != nil {
4141
logger := logging.RetrieveLogger(l.ctx)

mockdata/mocks.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func GetMockedAwsApiSession(svcName string, endpoints []*servicemocks.MockEndpoi
2323
awsConfig := aws.Config{
2424
Credentials: sc,
2525
Region: "us-east-1",
26-
EndpointResolverWithOptions: aws.EndpointResolverWithOptionsFunc(func(service, region string, options ...interface{}) (aws.Endpoint, error) {
26+
EndpointResolverWithOptions: aws.EndpointResolverWithOptionsFunc(func(service, region string, options ...any) (aws.Endpoint, error) {
2727
return aws.Endpoint{
2828
URL: ts.URL,
2929
Source: aws.EndpointSourceCustom,

v2/awsv1shim/logger.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const (
3030

3131
type debugLogger struct{}
3232

33-
func (l debugLogger) Log(args ...interface{}) {
33+
func (l debugLogger) Log(args ...any) {
3434
tokens := make([]string, 0, len(args))
3535
for _, arg := range args {
3636
if token, ok := arg.(string); ok {

v2/awsv1shim/resolvers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
"github.com/hashicorp/aws-sdk-go-base/v2/logging"
1414
)
1515

16-
func resolveCustomCABundle(ctx context.Context, configSources []interface{}) (value io.Reader, found bool, err error) {
16+
func resolveCustomCABundle(ctx context.Context, configSources []any) (value io.Reader, found bool, err error) {
1717
for _, source := range configSources {
1818
switch cfg := source.(type) {
1919
case configv2.LoadOptions:

0 commit comments

Comments
 (0)