diff --git a/github/api.go b/github/api.go index c60b1ce..770f66f 100644 --- a/github/api.go +++ b/github/api.go @@ -3,7 +3,7 @@ package github import ( "context" - "github.com/google/go-github/v67/github" + "github.com/google/go-github/v68/github" ) // APIClient is an interface that wraps the GitHub API client. diff --git a/github/github.go b/github/github.go index 260a507..89fb263 100644 --- a/github/github.go +++ b/github/github.go @@ -8,7 +8,7 @@ import ( "net/url" "strings" - "github.com/google/go-github/v67/github" + "github.com/google/go-github/v68/github" "golang.org/x/oauth2" ) diff --git a/github/github_test.go b/github/github_test.go index 3c9c7d5..df04112 100644 --- a/github/github_test.go +++ b/github/github_test.go @@ -6,7 +6,7 @@ import ( "fmt" "testing" - "github.com/google/go-github/v67/github" + "github.com/google/go-github/v68/github" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/thegeeklab/wp-github-comment/github/mocks" @@ -39,10 +39,10 @@ func TestGithubIssue_FindComment(t *testing.T) { Repo: "test-repo", }, comments: []*github.IssueComment{ - {Body: github.String("\ntest comment\n")}, + {Body: github.Ptr("\ntest comment\n")}, }, want: &github.IssueComment{ - Body: github.String("\ntest comment\n"), + Body: github.Ptr("\ntest comment\n"), }, }, { @@ -53,7 +53,7 @@ func TestGithubIssue_FindComment(t *testing.T) { Repo: "test-repo", }, comments: []*github.IssueComment{ - {Body: github.String("other comment")}, + {Body: github.Ptr("other comment")}, }, wantErr: ErrCommentNotFound, }, @@ -65,11 +65,11 @@ func TestGithubIssue_FindComment(t *testing.T) { Repo: "test-repo", }, comments: []*github.IssueComment{ - {Body: github.String("other comment")}, - {Body: github.String("\ntest comment\n")}, - {Body: github.String("another comment")}, + {Body: github.Ptr("other comment")}, + {Body: github.Ptr("\ntest comment\n")}, + {Body: github.Ptr("another comment")}, }, - want: &github.IssueComment{Body: github.String("\ntest comment\n")}, + want: &github.IssueComment{Body: github.Ptr("\ntest comment\n")}, }, } @@ -117,7 +117,7 @@ func TestGithubIssue_AddComment(t *testing.T) { Update: false, }, want: &github.IssueComment{ - Body: github.String("\ntest message\n"), + Body: github.Ptr("\ntest message\n"), }, }, { @@ -130,10 +130,10 @@ func TestGithubIssue_AddComment(t *testing.T) { Update: true, }, comments: []*github.IssueComment{ - {ID: github.Int64(123), Body: github.String("\ntest message\n")}, + {ID: github.Ptr(int64(123)), Body: github.Ptr("\ntest message\n")}, }, want: &github.IssueComment{ - Body: github.String("\ntest message\n"), + Body: github.Ptr("\ntest message\n"), }, }, { @@ -146,7 +146,7 @@ func TestGithubIssue_AddComment(t *testing.T) { Update: true, }, want: &github.IssueComment{ - Body: github.String("\ntest message\n"), + Body: github.Ptr("\ntest message\n"), }, }, { @@ -180,7 +180,7 @@ func TestGithubIssue_AddComment(t *testing.T) { mockClient. On("EditComment", mock.Anything, tt.issueOpt.Owner, tt.issueOpt.Repo, mock.Anything, mock.Anything). Return(&github.IssueComment{ - Body: github.String(fmt.Sprintf("\n%s\n", tt.issueOpt.Key, tt.issueOpt.Message)), + Body: github.Ptr(fmt.Sprintf("\n%s\n", tt.issueOpt.Key, tt.issueOpt.Message)), }, nil, nil) } @@ -188,7 +188,7 @@ func TestGithubIssue_AddComment(t *testing.T) { var comment *github.IssueComment if tt.wantErr == nil { comment = &github.IssueComment{ - Body: github.String(fmt.Sprintf("\n%s\n", tt.issueOpt.Key, tt.issueOpt.Message)), + Body: github.Ptr(fmt.Sprintf("\n%s\n", tt.issueOpt.Key, tt.issueOpt.Message)), } } diff --git a/github/mocks/mock_IssueService.go b/github/mocks/mock_IssueService.go index 878ff05..d54b7ce 100644 --- a/github/mocks/mock_IssueService.go +++ b/github/mocks/mock_IssueService.go @@ -5,7 +5,7 @@ package mocks import ( context "context" - github "github.com/google/go-github/v67/github" + github "github.com/google/go-github/v68/github" mock "github.com/stretchr/testify/mock" ) diff --git a/go.mod b/go.mod index fbf8487..17ddc1f 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/thegeeklab/wp-github-comment go 1.23.4 require ( - github.com/google/go-github/v67 v67.0.0 + github.com/google/go-github/v68 v68.0.0 github.com/rs/zerolog v1.33.0 github.com/stretchr/testify v1.10.0 github.com/thegeeklab/wp-plugin-go/v4 v4.0.4 diff --git a/go.sum b/go.sum index e50d7cc..02f5929 100644 --- a/go.sum +++ b/go.sum @@ -17,8 +17,8 @@ github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5x github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v67 v67.0.0 h1:g11NDAmfaBaCO8qYdI9fsmbaRipHNWRIU/2YGvlh4rg= -github.com/google/go-github/v67 v67.0.0/go.mod h1:zH3K7BxjFndr9QSeFibx4lTKkYS3K9nDanoI1NjaOtY= +github.com/google/go-github/v68 v68.0.0 h1:ZW57zeNZiXTdQ16qrDiZ0k6XucrxZ2CGmoTvcCyQG6s= +github.com/google/go-github/v68 v68.0.0/go.mod h1:K9HAUBovM2sLwM408A18h+wd9vqdLOEqTUCbnRIcx68= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=