@@ -51,13 +51,25 @@ type ListIssueOption struct {
51
51
State string
52
52
}
53
53
54
- // ListRepoIssues list one repos' issues
54
+ // ListIssues returns all issues assigned the authenticated user
55
+ func (c * Client ) ListIssues (opt ListIssueOption ) ([]* Issue , error ) {
56
+ issues := make ([]* Issue , 0 , 10 )
57
+ return issues , c .getParsedResponse ("GET" , fmt .Sprintf ("/issues?page=%d" , opt .Page ), nil , nil , & issues )
58
+ }
59
+
60
+ // ListUserIssues returns all issues assigned to the authenticated user
61
+ func (c * Client ) ListUserIssues (opt ListIssueOption ) ([]* Issue , error ) {
62
+ issues := make ([]* Issue , 0 , 10 )
63
+ return issues , c .getParsedResponse ("GET" , fmt .Sprintf ("/user/issues?page=%d" , opt .Page ), nil , nil , & issues )
64
+ }
65
+
66
+ // ListRepoIssues returns all issues for a given repository
55
67
func (c * Client ) ListRepoIssues (owner , repo string , opt ListIssueOption ) ([]* Issue , error ) {
56
68
issues := make ([]* Issue , 0 , 10 )
57
69
return issues , c .getParsedResponse ("GET" , fmt .Sprintf ("/repos/%s/%s/issues?page=%d" , owner , repo , opt .Page ), nil , nil , & issues )
58
70
}
59
71
60
- // GetIssue get some one issue of repository
72
+ // GetIssue returns a single issue for a given repository
61
73
func (c * Client ) GetIssue (owner , repo string , index int64 ) (* Issue , error ) {
62
74
issue := new (Issue )
63
75
return issue , c .getParsedResponse ("GET" , fmt .Sprintf ("/repos/%s/%s/issues/%d" , owner , repo , index ), nil , nil , issue )
@@ -73,7 +85,7 @@ type CreateIssueOption struct {
73
85
Closed bool `json:"closed"`
74
86
}
75
87
76
- // CreateIssue create an issue with options
88
+ // CreateIssue create a new issue for a given repository
77
89
func (c * Client ) CreateIssue (owner , repo string , opt CreateIssueOption ) (* Issue , error ) {
78
90
body , err := json .Marshal (& opt )
79
91
if err != nil {
@@ -93,7 +105,7 @@ type EditIssueOption struct {
93
105
State * string `json:"state"`
94
106
}
95
107
96
- // EditIssue modify an issue of repository
108
+ // EditIssue modify an existing issue for a given repository
97
109
func (c * Client ) EditIssue (owner , repo string , index int64 , opt EditIssueOption ) (* Issue , error ) {
98
110
body , err := json .Marshal (& opt )
99
111
if err != nil {
0 commit comments