Skip to content

Commit 2aa3002

Browse files
committed
small cleanup
1 parent 1cb52f9 commit 2aa3002

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

pkg/github/repository_resource.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func getRepositoryContent(client *github.Client, t translations.TranslationHelpe
1919
"repo://{owner}/{repo}/contents{/path*}", // Resource template
2020
t("RESOURCE_REPOSITORY_CONTENT_DESCRIPTION", "Repository Content"),
2121
),
22-
handlerFunc(client)
22+
repoContentsResourceHandler(client)
2323
}
2424

2525
// getRepositoryContent defines the resource template and handler for the Repository Content API.
@@ -28,7 +28,7 @@ func getRepositoryBranchContent(client *github.Client, t translations.Translatio
2828
"repo://{owner}/{repo}/refs/heads/{branch}/contents{/path*}", // Resource template
2929
t("RESOURCE_REPOSITORY_CONTENT_BRANCH_DESCRIPTION", "Repository Content for specific branch"),
3030
),
31-
handlerFunc(client)
31+
repoContentsResourceHandler(client)
3232
}
3333

3434
// getRepositoryContent defines the resource template and handler for the Repository Content API.
@@ -37,7 +37,7 @@ func getRepositoryCommitContent(client *github.Client, t translations.Translatio
3737
"repo://{owner}/{repo}/sha/{sha}/contents{/path*}", // Resource template
3838
t("RESOURCE_REPOSITORY_CONTENT_COMMIT_DESCRIPTION", "Repository Content for specific commit"),
3939
),
40-
handlerFunc(client)
40+
repoContentsResourceHandler(client)
4141
}
4242

4343
// getRepositoryContent defines the resource template and handler for the Repository Content API.
@@ -46,7 +46,7 @@ func getRepositoryTagContent(client *github.Client, t translations.TranslationHe
4646
"repo://{owner}/{repo}/refs/tags/{tag}/contents{/path*}", // Resource template
4747
t("RESOURCE_REPOSITORY_CONTENT_TAG_DESCRIPTION", "Repository Content for specific tag"),
4848
),
49-
handlerFunc(client)
49+
repoContentsResourceHandler(client)
5050
}
5151

5252
// getRepositoryContent defines the resource template and handler for the Repository Content API.
@@ -55,10 +55,10 @@ func getRepositoryPrContent(client *github.Client, t translations.TranslationHel
5555
"repo://{owner}/{repo}/refs/pull/{pr_number}/head/contents{/path*}", // Resource template
5656
t("RESOURCE_REPOSITORY_CONTENT_PR_DESCRIPTION", "Repository Content for specific pull request"),
5757
),
58-
handlerFunc(client)
58+
repoContentsResourceHandler(client)
5959
}
6060

61-
func handlerFunc(client *github.Client) func(ctx context.Context, request mcp.ReadResourceRequest) ([]mcp.ResourceContents, error) {
61+
func repoContentsResourceHandler(client *github.Client) func(ctx context.Context, request mcp.ReadResourceRequest) ([]mcp.ResourceContents, error) {
6262
return func(ctx context.Context, request mcp.ReadResourceRequest) ([]mcp.ResourceContents, error) { // Extract parameters from request.Params.URI
6363

6464
owner := request.Params.Arguments["owner"].([]string)[0]
@@ -110,7 +110,8 @@ func handlerFunc(client *github.Client) func(ctx context.Context, request mcp.Re
110110
}
111111
return resources, nil
112112

113-
} else if fileContent != nil {
113+
}
114+
if fileContent != nil {
114115
// Process the file content and return it as a binary resource
115116

116117
if fileContent.Content != nil {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy