@@ -210,7 +210,7 @@ func AddSubIssue(getClient GetClientFn, t translations.TranslationHelperFunc) (t
210210 }
211211
212212 subIssueRequest := github.SubIssueRequest {
213- SubIssueID : int64 (subIssueID ),
213+ SubIssueID : int64 (subIssueID ),
214214 ReplaceParent : ToBoolPtr (replaceParent ),
215215 }
216216
@@ -223,7 +223,7 @@ func AddSubIssue(getClient GetClientFn, t translations.TranslationHelperFunc) (t
223223 ), nil
224224 }
225225
226- defer func () { _ = resp .Body .Close () }()
226+ defer func () { _ = resp .Body .Close () }()
227227
228228 if resp .StatusCode != http .StatusCreated {
229229 body , err := io .ReadAll (resp .Body )
@@ -297,11 +297,11 @@ func ListSubIssues(getClient GetClientFn, t translations.TranslationHelperFunc)
297297 }
298298
299299 opts := & github.IssueListOptions {
300- ListOptions : github.ListOptions {
301- Page : page ,
302- PerPage : perPage ,
303- },
304- }
300+ ListOptions : github.ListOptions {
301+ Page : page ,
302+ PerPage : perPage ,
303+ },
304+ }
305305
306306 subIssues , resp , err := client .SubIssue .ListByIssue (ctx , owner , repo , int64 (issueNumber ), opts )
307307 if err != nil {
@@ -312,7 +312,7 @@ func ListSubIssues(getClient GetClientFn, t translations.TranslationHelperFunc)
312312 ), nil
313313 }
314314
315- defer func () { _ = resp .Body .Close () }()
315+ defer func () { _ = resp .Body .Close () }()
316316
317317 if resp .StatusCode != http .StatusOK {
318318 body , err := io .ReadAll (resp .Body )
@@ -329,7 +329,7 @@ func ListSubIssues(getClient GetClientFn, t translations.TranslationHelperFunc)
329329
330330 return mcp .NewToolResultText (string (r )), nil
331331 }
332-
332+
333333}
334334
335335// RemoveSubIssue creates a tool to remove a sub-issue from a parent issue.
@@ -503,48 +503,48 @@ func ReprioritizeSubIssue(getClient GetClientFn, t translations.TranslationHelpe
503503 }
504504
505505 client , err := getClient (ctx )
506- if err != nil {
507- return nil , fmt .Errorf ("failed to get GitHub client: %w" , err )
508- }
506+ if err != nil {
507+ return nil , fmt .Errorf ("failed to get GitHub client: %w" , err )
508+ }
509509
510- subIssueRequest := github.SubIssueRequest {
511- SubIssueID : int64 (subIssueID ),
512- }
510+ subIssueRequest := github.SubIssueRequest {
511+ SubIssueID : int64 (subIssueID ),
512+ }
513513
514514 if afterID != 0 {
515- afterIDInt64 := int64 (afterID )
516- subIssueRequest .AfterID = & afterIDInt64
517- }
518- if beforeID != 0 {
519- beforeIDInt64 := int64 (beforeID )
520- subIssueRequest .BeforeID = & beforeIDInt64
521- }
522-
523- subIssue , resp , err := client .SubIssue .Reprioritize (ctx , owner , repo , int64 (issueNumber ), subIssueRequest )
524- if err != nil {
525- return ghErrors .NewGitHubAPIErrorResponse (ctx ,
526- "failed to reprioritize sub-issue" ,
527- resp ,
528- err ,
529- ), nil
530- }
531-
532- defer func () { _ = resp .Body .Close () }()
533-
534- if resp .StatusCode != http .StatusOK {
535- body , err := io .ReadAll (resp .Body )
536- if err != nil {
537- return nil , fmt .Errorf ("failed to read response body: %w" , err )
538- }
539- return mcp .NewToolResultError (fmt .Sprintf ("failed to reprioritize sub-issue: %s" , string (body ))), nil
540- }
541-
542- r , err := json .Marshal (subIssue )
543- if err != nil {
544- return nil , fmt .Errorf ("failed to marshal response: %w" , err )
545- }
546-
547- return mcp .NewToolResultText (string (r )), nil
515+ afterIDInt64 := int64 (afterID )
516+ subIssueRequest .AfterID = & afterIDInt64
517+ }
518+ if beforeID != 0 {
519+ beforeIDInt64 := int64 (beforeID )
520+ subIssueRequest .BeforeID = & beforeIDInt64
521+ }
522+
523+ subIssue , resp , err := client .SubIssue .Reprioritize (ctx , owner , repo , int64 (issueNumber ), subIssueRequest )
524+ if err != nil {
525+ return ghErrors .NewGitHubAPIErrorResponse (ctx ,
526+ "failed to reprioritize sub-issue" ,
527+ resp ,
528+ err ,
529+ ), nil
530+ }
531+
532+ defer func () { _ = resp .Body .Close () }()
533+
534+ if resp .StatusCode != http .StatusOK {
535+ body , err := io .ReadAll (resp .Body )
536+ if err != nil {
537+ return nil , fmt .Errorf ("failed to read response body: %w" , err )
538+ }
539+ return mcp .NewToolResultError (fmt .Sprintf ("failed to reprioritize sub-issue: %s" , string (body ))), nil
540+ }
541+
542+ r , err := json .Marshal (subIssue )
543+ if err != nil {
544+ return nil , fmt .Errorf ("failed to marshal response: %w" , err )
545+ }
546+
547+ return mcp .NewToolResultText (string (r )), nil
548548 }
549549}
550550
0 commit comments