Skip to content

Commit 25ebcca

Browse files
committed
fix linter issues
1 parent 68f4569 commit 25ebcca

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

internal/ghmcp/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ func NewMCPServer(cfg MCPServerConfig) (*mcp.Server, error) {
143143
ghServer := github.NewServer(cfg.Version, &mcp.ServerOptions{
144144
Instructions: instructions,
145145
Logger: cfg.Logger,
146-
CompletionHandler: github.GitHubCompletionsHandler(getClient),
146+
CompletionHandler: github.CompletionsHandler(getClient),
147147
})
148148

149149
// Add middlewares

pkg/github/repository_resource_completions_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func TestRepositoryResourceCompletionHandler(t *testing.T) {
8282
}
8383

8484
func TestRepositoryResourceCompletionHandler_GetClientError(t *testing.T) {
85-
getClient := func(ctx context.Context) (*github.Client, error) {
85+
getClient := func(_ context.Context) (*github.Client, error) {
8686
return nil, errors.New("client error")
8787
}
8888

@@ -246,7 +246,7 @@ func TestRepositoryResourceArgumentResolvers_Existence(t *testing.T) {
246246

247247
func TestRepositoryResourceCompletionHandler_MaxResults(t *testing.T) {
248248
// Test that results are limited to 100 items
249-
getClient := func(ctx context.Context) (*github.Client, error) {
249+
getClient := func(_ context.Context) (*github.Client, error) {
250250
return &github.Client{}, nil
251251
}
252252

pkg/github/server.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,14 @@ func NewServer(version string, opts *mcp.ServerOptions) *mcp.Server {
2727
return s
2828
}
2929

30-
func GitHubCompletionsHandler(getClient GetClientFn) func(ctx context.Context, req *mcp.CompleteRequest) (*mcp.CompleteResult, error) {
30+
func CompletionsHandler(getClient GetClientFn) func(ctx context.Context, req *mcp.CompleteRequest) (*mcp.CompleteResult, error) {
3131
return func(ctx context.Context, req *mcp.CompleteRequest) (*mcp.CompleteResult, error) {
3232
switch req.Params.Ref.Type {
3333
case "ref/resource":
3434
if strings.HasPrefix(req.Params.Ref.URI, "repo://") {
3535
return RepositoryResourceCompletionHandler(getClient)(ctx, req)
36-
} else {
37-
return nil, fmt.Errorf("unsupported resource URI: %s", req.Params.Ref.URI)
3836
}
37+
return nil, fmt.Errorf("unsupported resource URI: %s", req.Params.Ref.URI)
3938
case "ref/prompt":
4039
return nil, nil
4140
default:

0 commit comments

Comments
 (0)