Skip to content

Commit

Permalink
Fix code snippets in devguide for endpointsv2 (#2301)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikpivkin authored Oct 6, 2023
1 parent 63f481f commit 52072ab
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions content/en/docs/configuring-sdk/endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,13 @@ func (*resolverV2) ResolveEndpoint(ctx context.Context, params s3.EndpointParame
smithyendpoints.Endpoint, error,
) {
if /* input params or caller context indicate we must route somewhere */ {
return smithyEndpoints.Endpoint{
URI: url.Parse("https://custom.service.endpoint/"),
u, err := url.Parse("https://custom.service.endpoint/")
if err != nil {
return smithyendpoints.Endpoint{}, err
}
return smithyendpoints.Endpoint{
URI: *u,
}, nil
}

// delegate back to the default v2 resolver otherwise
Expand Down Expand Up @@ -382,9 +386,13 @@ func (*staticResolver) ResolveEndpoint(ctx context.Context, params svc.EndpointP
smithyendpoints.Endpoint, error,
) {
// This value will be used as-is when making the request.
return smithyEndpoints.Endpoint{
URI: url.Parse("https://custom.endpoint.api/"),
u, err := url.Parse("https://custom.endpoint.api/")
if err != nil {
return smithyendpoints.Endpoint{}, err
}
return smithyendpoints.Endpoint{
URI: *u,
}, nil
}

client := svc.NewFromConfig(cfg, func (o *svc.Options) {
Expand Down

0 comments on commit 52072ab

Please sign in to comment.