refactor: fix lint errors; improve error handling

This commit is contained in:
yusing
2026-02-22 16:04:25 +08:00
parent 3a7d1f8b18
commit 0f78158c64
40 changed files with 191 additions and 136 deletions

View File

@@ -2,6 +2,7 @@ package route
import (
"context"
"errors"
"fmt"
entrypoint "github.com/yusing/godoxy/internal/entrypoint/types"
@@ -17,7 +18,7 @@ func checkExists(ctx context.Context, r types.Route) error {
}
ep := entrypoint.FromCtx(ctx)
if ep == nil {
return fmt.Errorf("entrypoint not found in context")
return errors.New("entrypoint not found in context")
}
var (
existing types.Route