From c05a7bb741600b9b2947bd0356c1a4497bbb061f Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Thu, 10 Nov 2016 23:08:54 +0800 Subject: [PATCH] bug fixed & lint fixed --- gitea/issue.go | 36 ++++++++++++++++++------------------ gitea/issue_comment.go | 2 +- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/gitea/issue.go b/gitea/issue.go index 002cd26..ca8a5fc 100644 --- a/gitea/issue.go +++ b/gitea/issue.go @@ -11,14 +11,14 @@ import ( "time" ) -// PRStateType issue state type -type PRStateType string +// StateType issue state type +type StateType string const ( - // PRStateOpen pr is opend - PRStateOpen PRStateType = "open" - // PRStateClosed pr is closed - PRStateClosed PRStateType = "closed" + // StateOpen pr is opend + StateOpen StateType = "open" + // StateClosed pr is closed + StateClosed StateType = "closed" ) // PullRequestMeta PR info if an issue is a PR @@ -29,18 +29,18 @@ type PullRequestMeta struct { // Issue an issue to a repository type Issue struct { - ID int64 `json:"id"` - Index int64 `json:"number"` - Poster *User `json:"user"` - Title string `json:"title"` - Body string `json:"body"` - Labels []*Label `json:"labels"` - Milestone *Milestone `json:"milestone"` - Assignee *User `json:"assignee"` - State PRStateType `json:"state"` - Comments int `json:"comments"` - Created time.Time `json:"created_at"` - Updated time.Time `json:"updated_at"` + ID int64 `json:"id"` + Index int64 `json:"number"` + Poster *User `json:"user"` + Title string `json:"title"` + Body string `json:"body"` + Labels []*Label `json:"labels"` + Milestone *Milestone `json:"milestone"` + Assignee *User `json:"assignee"` + State StateType `json:"state"` + Comments int `json:"comments"` + Created time.Time `json:"created_at"` + Updated time.Time `json:"updated_at"` PullRequest *PullRequestMeta `json:"pull_request"` } diff --git a/gitea/issue_comment.go b/gitea/issue_comment.go index ccd13b6..c6978f4 100644 --- a/gitea/issue_comment.go +++ b/gitea/issue_comment.go @@ -30,7 +30,7 @@ func (c *Client) ListIssueComments(owner, repo string, index int64) ([]*Comment, } // ListRepoIssueComments list comments for a given repo. -func (c *Client) ListRepoIssuecomments(owner, repo string) ([]*Comment, error) { +func (c *Client) ListRepoIssueComments(owner, repo string) ([]*Comment, error) { comments := make([]*Comment, 0, 10) return comments, c.getParsedResponse("GET", fmt.Sprintf("/repos/%s/%s/issues/comments", owner, repo), nil, nil, &comments) }