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
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:
@@ -4,6 +4,7 @@
|
|||||||
package v2
|
package v2
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
repo_model "code.gitcaddy.com/server/v3/models/repo"
|
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
|
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()
|
templates := pages_module.ValidTemplates()
|
||||||
displayNames := pages_module.TemplateDisplayNames()
|
displayNames := pages_module.TemplateDisplayNames()
|
||||||
|
|
||||||
@@ -647,7 +648,7 @@ func resolveOwnerRepo(args map[string]any) (string, string, error) {
|
|||||||
owner, _ := args["owner"].(string)
|
owner, _ := args["owner"].(string)
|
||||||
repo, _ := args["repo"].(string)
|
repo, _ := args["repo"].(string)
|
||||||
if owner == "" || repo == "" {
|
if owner == "" || repo == "" {
|
||||||
return "", "", fmt.Errorf("owner and repo are required")
|
return "", "", errors.New("owner and repo are required")
|
||||||
}
|
}
|
||||||
return owner, repo, nil
|
return owner, repo, nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user