Skip to content
This repository was archived by the owner on Aug 7, 2025. It is now read-only.

Commit 04fcc19

Browse files
authored
fix: tabs vs spaces
1 parent 3af85c6 commit 04fcc19

File tree

1 file changed

+36
-36
lines changed
  • content/en/user-guide/integrations/testcontainers

1 file changed

+36
-36
lines changed

content/en/user-guide/integrations/testcontainers/index.md

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -78,49 +78,49 @@ using var client = new AmazonS3Client(config);
7878
{{< /tab >}}
7979
{{< tab header="Go" lang="go">}}
8080
type resolverV2 struct {
81-
// you could inject additional application context here as well
81+
// you could inject additional application context here as well
8282
}
8383

8484
func (*resolverV2) ResolveEndpoint(ctx context.Context, params s3.EndpointParameters) (
85-
smithyendpoints.Endpoint, error,
85+
smithyendpoints.Endpoint, error,
8686
) {
87-
// delegate back to the default v2 resolver otherwise
88-
return s3.NewDefaultEndpointResolverV2().ResolveEndpoint(ctx, params)
87+
// delegate back to the default v2 resolver otherwise
88+
return s3.NewDefaultEndpointResolverV2().ResolveEndpoint(ctx, params)
8989
}
9090

9191
func s3Client(ctx context.Context, l *localstack.LocalStackContainer) (*s3.Client, error) {
92-
mappedPort, err := l.MappedPort(ctx, nat.Port("4566/tcp"))
93-
if err != nil {
94-
return nil, err
95-
}
96-
97-
provider, err := testcontainers.NewDockerProvider()
98-
if err != nil {
99-
return nil, err
100-
}
101-
defer provider.Close()
102-
103-
host, err := provider.DaemonHost(ctx)
104-
if err != nil {
105-
return nil, err
106-
}
107-
108-
awsCfg, err := config.LoadDefaultConfig(context.TODO(),
109-
config.WithRegion(region),
110-
config.WithCredentialsProvider(credentials.NewStaticCredentialsProvider(accesskey, secretkey, token)),
111-
)
112-
if err != nil {
113-
return nil, err
114-
}
115-
116-
// reference: https://aws.github.io/aws-sdk-go-v2/docs/configuring-sdk/endpoints/#with-both
117-
client := s3.NewFromConfig(awsCfg, func(o *s3.Options) {
118-
o.BaseEndpoint = aws.String("http://" + host + ":" + mappedPort.Port())
119-
o.EndpointResolverV2 = &resolverV2{}
120-
o.UsePathStyle = true
121-
})
122-
123-
return client, nil
92+
mappedPort, err := l.MappedPort(ctx, nat.Port("4566/tcp"))
93+
if err != nil {
94+
return nil, err
95+
}
96+
97+
provider, err := testcontainers.NewDockerProvider()
98+
if err != nil {
99+
return nil, err
100+
}
101+
defer provider.Close()
102+
103+
host, err := provider.DaemonHost(ctx)
104+
if err != nil {
105+
return nil, err
106+
}
107+
108+
awsCfg, err := config.LoadDefaultConfig(context.TODO(),
109+
config.WithRegion(region),
110+
config.WithCredentialsProvider(credentials.NewStaticCredentialsProvider(accesskey, secretkey, token)),
111+
)
112+
if err != nil {
113+
return nil, err
114+
}
115+
116+
// reference: https://aws.github.io/aws-sdk-go-v2/docs/configuring-sdk/endpoints/#with-both
117+
client := s3.NewFromConfig(awsCfg, func(o *s3.Options) {
118+
o.BaseEndpoint = aws.String("http://" + host + ":" + mappedPort.Port())
119+
o.EndpointResolverV2 = &resolverV2{}
120+
o.UsePathStyle = true
121+
})
122+
123+
return client, nil
124124
}
125125
{{< /tab >}}
126126
{{< tab header="Java" lang="java">}}

0 commit comments

Comments
 (0)