From 1b0bba09b914dc0cd85dc4ed515fbaeef82f1f3d Mon Sep 17 00:00:00 2001 From: logikonline Date: Sun, 5 Apr 2026 04:03:02 -0400 Subject: [PATCH] style(mcp): use errors.New for static error messages Replaces fmt.Errorf with errors.New for static error message in resolveOwnerRepo. Marks unused context and args parameters with underscore in toolListLandingTemplates. --- routers/api/v2/mcp_pages.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/routers/api/v2/mcp_pages.go b/routers/api/v2/mcp_pages.go index 203b091401..a96e9781b0 100644 --- a/routers/api/v2/mcp_pages.go +++ b/routers/api/v2/mcp_pages.go @@ -4,6 +4,7 @@ package v2 import ( + "errors" "fmt" repo_model "code.gitcaddy.com/server/v3/models/repo" @@ -269,7 +270,7 @@ func toolGetLandingConfig(ctx *context.APIContext, args map[string]any) (any, er return buildFullResponse(config), nil } -func toolListLandingTemplates(ctx *context.APIContext, args map[string]any) (any, error) { +func toolListLandingTemplates(_ *context.APIContext, _ map[string]any) (any, error) { templates := pages_module.ValidTemplates() displayNames := pages_module.TemplateDisplayNames() @@ -647,7 +648,7 @@ func resolveOwnerRepo(args map[string]any) (string, string, error) { owner, _ := args["owner"].(string) repo, _ := args["repo"].(string) if owner == "" || repo == "" { - return "", "", fmt.Errorf("owner and repo are required") + return "", "", errors.New("owner and repo are required") } return owner, repo, nil }