8000 fix linter · github/github-mcp-server@b031f21 · GitHub
[go: up one dir, main page]

Skip to content

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b031f21

Browse files
tonytrgSamMorrowDrums
authored andcommitted
fix linter
1 parent 50cfb6d commit b031f21

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

pkg/github/repositories.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -514,23 +514,24 @@ func GetFileContents(getClient GetClientFn, getRawClient raw.GetRawClientFn, t t
514514
contentType := resp.Header.Get("Content-Type")
515515

516516
var resourceURI string
517-
if sha != "" {
518-
// do a safe url join
517+
switch {
518+
case sha != "":
519519
resourceURI, err = url.JoinPath("repo://", owner, repo, "sha", sha, "contents", path)
520520
if err != nil {
521521
return nil, fmt.Errorf("failed to create resource URI: %w", err)
522522
}
523-
} else if ref != "" {
523+
case ref != "":
524524
resourceURI, err = url.JoinPath("repo://", owner, repo, ref, "contents", path)
525525
if err != nil {
526526
return nil, fmt.Errorf("failed to create resource URI: %w", err)
527527
}
528-
} else {
528+
default:
529529
resourceURI, err = url.JoinPath("repo://", owner, repo, "contents", path)
530530
if err != nil {
531531
return nil, fmt.Errorf("failed to create resource URI: %w", err)
532532
}
533533
}
534+
534535
if strings.HasPrefix(contentType, "application") || strings.HasPrefix(contentType, "text") {
535536
return mcp.NewToolResultResource("successfully downloaded text file", mcp.TextResourceContents{
536537
URI: resourceURI,

0 commit comments

Comments
 (0)
0