2
0

style(mcp): use errors.New for static error messages
Some checks failed
Build and Release / Integration Tests (PostgreSQL) (push) Successful in 3m19s
Build and Release / Create Release (push) Successful in 0s
Build and Release / Lint (push) Failing after 11m49s
Build and Release / Build Binaries (amd64, linux, linux-latest) (push) Has been skipped
Build and Release / Build Binaries (amd64, windows, windows-latest) (push) Has been skipped
Build and Release / Build Binaries (amd64, darwin, macos) (push) Has been skipped
Build and Release / Build Binaries (arm64, darwin, macos) (push) Has been skipped
Build and Release / Build Binary (linux/arm64) (push) Has been skipped
Build and Release / Unit Tests (push) Successful in 12m52s

Replaces fmt.Errorf with errors.New for static error message in resolveOwnerRepo. Marks unused context and args parameters with underscore in toolListLandingTemplates.
This commit is contained in:
2026-04-05 04:03:02 -04:00
parent 0c0d1c1493
commit 1b0bba09b9

View File

@@ -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
}