Skip to content

Commit c9d9bba

Browse files
corylanouclaude
andcommitted
fix: remove unused customEndpointResolver to fix staticcheck lint error
The customEndpointResolver type and its ResolveEndpoint method were defined but never used, causing staticcheck to fail. Removed the dead code and associated import. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 7959feb commit c9d9bba

File tree

1 file changed

+0
-33
lines changed

1 file changed

+0
-33
lines changed

s3/replica_client.go

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import (
2323
"github.com/aws/aws-sdk-go-v2/service/s3"
2424
"github.com/aws/aws-sdk-go-v2/service/s3/types"
2525
"github.com/aws/smithy-go"
26-
smithyendpoints "github.com/aws/smithy-go/endpoints"
2726
"github.com/superfly/ltx"
2827
"golang.org/x/sync/errgroup"
2928

@@ -41,36 +40,6 @@ const DefaultRegion = "us-east-1"
4140

4241
var _ litestream.ReplicaClient = (*ReplicaClient)(nil)
4342

44-
// customEndpointResolver implements the EndpointResolverV2 interface for custom endpoints
45-
type customEndpointResolver struct {
46-
endpoint string
47-
}
48-
49-
func (r *customEndpointResolver) ResolveEndpoint(ctx context.Context, params s3.EndpointParameters) (smithyendpoints.Endpoint, error) {
50-
// For debugging
51-
// fmt.Printf("ResolveEndpoint called with bucket: %v\n", aws.ToString(params.Bucket))
52-
53-
u, err := url.Parse(r.endpoint)
54-
if err != nil {
55-
return smithyendpoints.Endpoint{}, fmt.Errorf("invalid endpoint URL: %w", err)
56-
}
57-
58-
// Create the endpoint with proper settings
59-
ep := smithyendpoints.Endpoint{
60-
URI: *u,
61-
Headers: http.Header{},
62-
}
63-
64-
// Set properties based on the endpoint
65-
if u.Scheme == "http" {
66-
// This tells the SDK to use HTTP instead of HTTPS
67-
// For HTTP endpoints, we don't need special properties
68-
// The SDK will handle it based on the URI scheme
69-
}
70-
71-
return ep, nil
72-
}
73-
7443
// ReplicaClient is a client for writing LTX files to S3.
7544
type ReplicaClient struct {
7645
mu sync.Mutex
@@ -187,8 +156,6 @@ func (c *ReplicaClient) Init(ctx context.Context) (err error) {
187156
if strings.HasPrefix(c.Endpoint, "http://") {
188157
o.EndpointOptions.DisableHTTPS = true
189158
}
190-
// Alternative: Use custom endpoint resolver for more control
191-
// o.EndpointResolverV2 = &customEndpointResolver{endpoint: c.Endpoint}
192159
})
193160
}
194161

0 commit comments

Comments
 (0)