Skip to content

Commit

Permalink
Rename bucket constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
sevein committed Apr 25, 2024
1 parent 1803eeb commit c8bfae7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions bucket/bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ type Config struct {
PathStyle bool
}

// WithConfig opens a bucket based on the provided configuration. It defaults to
// using AWS SDK v2 via s3blob.OpenBucketV2 unless the URL field is specified,
// in which case it uses blob.OpenBucket.
func WithConfig(ctx context.Context, c *Config) (*blob.Bucket, error) {
// NewWithConfig opens a bucket based on the provided configuration. It defaults
// to using AWS SDK v2 via s3blob.OpenBucketV2 unless the URL field is
// specified, in which case it uses blob.OpenBucket.
func NewWithConfig(ctx context.Context, c *Config) (*blob.Bucket, error) {
if c == nil {
return nil, errors.New("config is undefined")
}
Expand Down
4 changes: 2 additions & 2 deletions bucket/bucket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
bucket "go.artefactual.dev/tools/bucket"
)

func TestWithConfig(t *testing.T) {
func TestNewWithConfig(t *testing.T) {
t.Parallel()

type test struct {
Expand Down Expand Up @@ -96,7 +96,7 @@ func TestWithConfig(t *testing.T) {
t.Run(name, func(t *testing.T) {
t.Parallel()

b, err := bucket.WithConfig(context.Background(), tc.config)
b, err := bucket.NewWithConfig(context.Background(), tc.config)
if b != nil {
defer b.Close()
}
Expand Down

0 comments on commit c8bfae7

Please sign in to comment.