diff --git a/notifier/gitlab/gitlab.go b/notifier/gitlab/gitlab.go index 33b7add..09201a6 100644 --- a/notifier/gitlab/gitlab.go +++ b/notifier/gitlab/gitlab.go @@ -1,8 +1,6 @@ package gitlab import ( - "fmt" - gitlab "github.com/xanzy/go-gitlab" ) @@ -23,25 +21,25 @@ type GitLab struct { // CreateMergeRequestNote is a wrapper of https://godoc.org/github.com/xanzy/go-gitlab#NotesService.CreateMergeRequestNote func (g *GitLab) CreateMergeRequestNote(mergeRequest int, opt *gitlab.CreateMergeRequestNoteOptions, options ...gitlab.OptionFunc) (*gitlab.Note, *gitlab.Response, error) { - return g.Client.Notes.CreateMergeRequestNote(fmt.Sprintf("%s/%s", g.namespace, g.project), mergeRequest, opt, options...) + return g.Client.Notes.CreateMergeRequestNote(g.project, mergeRequest, opt, options...) } // DeleteMergeRequestNote is a wrapper of https://godoc.org/github.com/xanzy/go-gitlab#NotesService.DeleteMergeRequestNote func (g *GitLab) DeleteMergeRequestNote(mergeRequest, note int, options ...gitlab.OptionFunc) (*gitlab.Response, error) { - return g.Client.Notes.DeleteMergeRequestNote(fmt.Sprintf("%s/%s", g.namespace, g.project), mergeRequest, note, options...) + return g.Client.Notes.DeleteMergeRequestNote(g.project, mergeRequest, note, options...) } // ListMergeRequestNotes is a wrapper of https://godoc.org/github.com/xanzy/go-gitlab#NotesService.ListMergeRequestNotes func (g *GitLab) ListMergeRequestNotes(mergeRequest int, opt *gitlab.ListMergeRequestNotesOptions, options ...gitlab.OptionFunc) ([]*gitlab.Note, *gitlab.Response, error) { - return g.Client.Notes.ListMergeRequestNotes(fmt.Sprintf("%s/%s", g.namespace, g.project), mergeRequest, opt, options...) + return g.Client.Notes.ListMergeRequestNotes(g.project, mergeRequest, opt, options...) } // PostCommitComment is a wrapper of https://godoc.org/github.com/xanzy/go-gitlab#CommitsService.PostCommitComment func (g *GitLab) PostCommitComment(sha string, opt *gitlab.PostCommitCommentOptions, options ...gitlab.OptionFunc) (*gitlab.CommitComment, *gitlab.Response, error) { - return g.Client.Commits.PostCommitComment(fmt.Sprintf("%s/%s", g.namespace, g.project), sha, opt, options...) + return g.Client.Commits.PostCommitComment(g.project, sha, opt, options...) } // ListCommits is a wrapper of https://godoc.org/github.com/xanzy/go-gitlab#CommitsService.ListCommits func (g *GitLab) ListCommits(opt *gitlab.ListCommitsOptions, options ...gitlab.OptionFunc) ([]*gitlab.Commit, *gitlab.Response, error) { - return g.Client.Commits.ListCommits(fmt.Sprintf("%s/%s", g.namespace, g.project), opt, options...) + return g.Client.Commits.ListCommits(g.project, opt, options...) }