chore: fmt.Errorf(static) → errors.New

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Claude 2026-02-24 16:22:37 +00:00
parent cacc1ab3c8
commit da9c133f1f
No known key found for this signature in database
GPG key ID: AF404715446AEB41
2 changed files with 6 additions and 4 deletions

View file

@ -2,6 +2,7 @@
package agentci
import (
"errors"
"fmt"
"forge.lthn.ai/core/go/pkg/config"
@ -125,7 +126,7 @@ func SaveAgent(cfg *config.Config, name string, ac AgentConfig) error {
func RemoveAgent(cfg *config.Config, name string) error {
var agents map[string]AgentConfig
if err := cfg.Get("agentci.agents", &agents); err != nil {
return fmt.Errorf("no agents configured")
return errors.New("no agents configured")
}
if _, ok := agents[name]; !ok {
return fmt.Errorf("agent %q not found", name)

View file

@ -2,6 +2,7 @@ package jobrunner
import (
"encoding/json"
"errors"
"fmt"
"os"
"path/filepath"
@ -52,7 +53,7 @@ type Journal struct {
// NewJournal creates a new Journal rooted at baseDir.
func NewJournal(baseDir string) (*Journal, error) {
if baseDir == "" {
return nil, fmt.Errorf("journal base directory is required")
return nil, errors.New("journal base directory is required")
}
return &Journal{baseDir: baseDir}, nil
}
@ -90,10 +91,10 @@ func sanitizePathComponent(name string) (string, error) {
// Append writes a journal entry for the given signal and result.
func (j *Journal) Append(signal *PipelineSignal, result *ActionResult) error {
if signal == nil {
return fmt.Errorf("signal is required")
return errors.New("signal is required")
}
if result == nil {
return fmt.Errorf("result is required")
return errors.New("result is required")
}
entry := JournalEntry{