bug fixed & lint fixed
This commit is contained in:
parent
cc453bfe27
commit
c05a7bb741
2 changed files with 19 additions and 19 deletions
|
@ -11,14 +11,14 @@ import (
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
// PRStateType issue state type
|
// StateType issue state type
|
||||||
type PRStateType string
|
type StateType string
|
||||||
|
|
||||||
const (
|
const (
|
||||||
// PRStateOpen pr is opend
|
// StateOpen pr is opend
|
||||||
PRStateOpen PRStateType = "open"
|
StateOpen StateType = "open"
|
||||||
// PRStateClosed pr is closed
|
// StateClosed pr is closed
|
||||||
PRStateClosed PRStateType = "closed"
|
StateClosed StateType = "closed"
|
||||||
)
|
)
|
||||||
|
|
||||||
// PullRequestMeta PR info if an issue is a PR
|
// PullRequestMeta PR info if an issue is a PR
|
||||||
|
@ -29,18 +29,18 @@ type PullRequestMeta struct {
|
||||||
|
|
||||||
// Issue an issue to a repository
|
// Issue an issue to a repository
|
||||||
type Issue struct {
|
type Issue struct {
|
||||||
ID int64 `json:"id"`
|
ID int64 `json:"id"`
|
||||||
Index int64 `json:"number"`
|
Index int64 `json:"number"`
|
||||||
Poster *User `json:"user"`
|
Poster *User `json:"user"`
|
||||||
Title string `json:"title"`
|
Title string `json:"title"`
|
||||||
Body string `json:"body"`
|
Body string `json:"body"`
|
||||||
Labels []*Label `json:"labels"`
|
Labels []*Label `json:"labels"`
|
||||||
Milestone *Milestone `json:"milestone"`
|
Milestone *Milestone `json:"milestone"`
|
||||||
Assignee *User `json:"assignee"`
|
Assignee *User `json:"assignee"`
|
||||||
State PRStateType `json:"state"`
|
State StateType `json:"state"`
|
||||||
Comments int `json:"comments"`
|
Comments int `json:"comments"`
|
||||||
Created time.Time `json:"created_at"`
|
Created time.Time `json:"created_at"`
|
||||||
Updated time.Time `json:"updated_at"`
|
Updated time.Time `json:"updated_at"`
|
||||||
|
|
||||||
PullRequest *PullRequestMeta `json:"pull_request"`
|
PullRequest *PullRequestMeta `json:"pull_request"`
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@ func (c *Client) ListIssueComments(owner, repo string, index int64) ([]*Comment,
|
||||||
}
|
}
|
||||||
|
|
||||||
// ListRepoIssueComments list comments for a given repo.
|
// 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)
|
comments := make([]*Comment, 0, 10)
|
||||||
return comments, c.getParsedResponse("GET", fmt.Sprintf("/repos/%s/%s/issues/comments", owner, repo), nil, nil, &comments)
|
return comments, c.getParsedResponse("GET", fmt.Sprintf("/repos/%s/%s/issues/comments", owner, repo), nil, nil, &comments)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue