Skip to content

Commit

Permalink
Rename MakeBuilder to NewBuilder
Browse files Browse the repository at this point in the history
And also rename MakePublisher to NewPublisher.

For more idiomatic constructor function names.
  • Loading branch information
halvards committed May 19, 2021
1 parent 30dccf5 commit b5536ec
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions pkg/commands/publisher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ func TestPublishImages(t *testing.T) {
bo := &options.BuildOptions{
ConcurrentBuilds: 1,
}
builder, err := MakeBuilder(ctx, bo)
builder, err := NewBuilder(ctx, bo)
if err != nil {
t.Fatalf("%s: MakeBuilder(): %v", test.description, err)
}
po := &options.PublishOptions{
DockerRepo: repo,
PreserveImportPaths: true,
}
publisher, err := MakePublisher(po)
publisher, err := NewPublisher(po)
if err != nil {
t.Fatalf("%s: MakePublisher(): %v", test.description, err)
}
Expand Down
8 changes: 4 additions & 4 deletions pkg/commands/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ func gobuildOptions(bo *options.BuildOptions) ([]build.Option, error) {
return opts, nil
}

// MakeBuilder creates a ko builder
func MakeBuilder(ctx context.Context, bo *options.BuildOptions) (build.Interface, error) {
// NewBuilder creates a ko builder
func NewBuilder(ctx context.Context, bo *options.BuildOptions) (build.Interface, error) {
return makeBuilder(ctx, bo)
}

Expand Down Expand Up @@ -142,8 +142,8 @@ func makeBuilder(ctx context.Context, bo *options.BuildOptions) (*build.Caching,
return build.NewCaching(innerBuilder)
}

// MakePublisher creates a ko publisher
func MakePublisher(po *options.PublishOptions) (publish.Interface, error) {
// NewPublisher creates a ko publisher
func NewPublisher(po *options.PublishOptions) (publish.Interface, error) {
return makePublisher(po)
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/commands/resolver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func TestMakeBuilder(t *testing.T) {
bo := &options.BuildOptions{
ConcurrentBuilds: 1,
}
builder, err := MakeBuilder(ctx, bo)
builder, err := NewBuilder(ctx, bo)
if err != nil {
t.Fatalf("MakeBuilder(): %v", err)
}
Expand All @@ -164,7 +164,7 @@ func TestMakePublisher(t *testing.T) {
DockerRepo: repo,
PreserveImportPaths: true,
}
publisher, err := MakePublisher(po)
publisher, err := NewPublisher(po)
if err != nil {
t.Fatalf("MakePublisher(): %v", err)
}
Expand Down

0 comments on commit b5536ec

Please sign in to comment.