Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package changelog
package generator

import (
"context"
Expand Down Expand Up @@ -28,8 +28,8 @@ type Generator struct {
repo string
}

// NewGenerator creates a new changelog generator
func NewGenerator(client *github.Client, owner, repo string) *Generator {
// New creates a new changelog generator
func New(client *github.Client, owner, repo string) *Generator {
return &Generator{
client: client,
owner: owner,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package changelog_test
package generator_test

import (
"context"
Expand All @@ -11,7 +11,7 @@ import (

"github.com/google/go-github/v68/github"
"github.com/gorilla/mux"
"github.com/kgateway-dev/changelog-generator/internal/changelog"
"github.com/kgateway-dev/changelog-generator/internal/generator"
"github.com/migueleliasweb/go-github-mock/src/mock"
)

Expand Down Expand Up @@ -71,7 +71,7 @@ func TestGenerateChangelog_Mocked(t *testing.T) {
ghClient := github.NewClient(mockedHTTPClient)

// Create changelog generator
generator := changelog.NewGenerator(ghClient, "foo", "bar")
generator := generator.New(ghClient, "foo", "bar")

// Generate changelog
changelog, err := generator.Generate(context.Background(), "start-sha", "end-sha")
Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"os"

"github.com/google/go-github/v68/github"
"github.com/kgateway-dev/changelog-generator/internal/changelog"
"github.com/kgateway-dev/changelog-generator/internal/generator"
"github.com/spf13/cobra"
)

Expand All @@ -21,7 +21,7 @@ func main() {
ctx := context.Background()
client := github.NewClient(nil).WithAuthToken(token)

g := changelog.NewGenerator(client, owner, repo)
g := generator.New(client, owner, repo)
changelog, err := g.Generate(ctx, startSHA, endSHA)
if err != nil {
return fmt.Errorf("failed to generate changelog: %v", err)
Expand Down