Can't request ListObjectsV2 for api error NotImplemented

Hi all,

I use AWS s3 package(github.com/aws/aws-sdk-go-v2 ) ingolang for access Cloudflare R2 .
Recently,WithEndpointResolverWithOptions function is deprecated used in official like this aws-sdk-go · Cloudflare R2 docs.

So, I use WithEndpointResolverV2 instaed of WithEndpointResolverWithOptions.
However, I got the error below.
api error NotImplemented: ListBuckets search parameter list-type not implemented

My codes are like this.

func New(ctx context.Context) (*s3.Client, error) {
	endpoint, err := env.CloudflareEndpoint.Get()
	if err != nil {
		return nil, err
	}
	accessKeyID, err := env.CloudflareAccessKeyID.Get()
	if err != nil {
		return nil, err
	}
	secretAccessKey, err := env.CloudflareSecretAccessKey.Get()
	if err != nil {
		return nil, err
	}

	cfg, err := config.LoadDefaultConfig(
		ctx,
		config.WithCredentialsProvider(credentials.NewStaticCredentialsProvider(accessKeyID, secretAccessKey, "")),
		config.WithRegion("auto"),
	)
	if err != nil {
		return nil, errors.WithStack(err)
	}

	return s3.NewFromConfig(cfg, s3.WithEndpointResolverV2(s3EndpointResolver{url: endpoint})), nil
}

type s3EndpointResolver struct {
	url string
}

func (e s3EndpointResolver) ResolveEndpoint(ctx context.Context, params s3.EndpointParameters) (smithyendpoints.Endpoint, error) {
	u, err := url.Parse(e.url)
	if err != nil {
		return smithyendpoints.Endpoint{}, err
	}

	return smithyendpoints.Endpoint{
		URI: *u,
	}, nil
}

I don’t no idea to solve this.

I found the similar article.

This problem is occurred by the same reason ?