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:25:54 +00:00
parent f1e55b370f
commit d457b74d80
No known key found for this signature in database
GPG key ID: AF404715446AEB41
3 changed files with 9 additions and 6 deletions

View file

@ -1,6 +1,7 @@
package agent
import (
"errors"
"fmt"
"os"
"os/exec"
@ -8,9 +9,9 @@ import (
"strings"
"time"
"forge.lthn.ai/core/cli/pkg/cli"
agentic "forge.lthn.ai/core/go-agentic"
"forge.lthn.ai/core/go-scm/agentci"
"forge.lthn.ai/core/cli/pkg/cli"
"forge.lthn.ai/core/go/pkg/config"
)
@ -299,7 +300,7 @@ func agentSetupCmd() *cli.Command {
// Find the setup script relative to the binary or in known locations.
scriptPath := findSetupScript()
if scriptPath == "" {
return fmt.Errorf("agent-setup.sh not found — expected in scripts/ directory")
return errors.New("agent-setup.sh not found — expected in scripts/ directory")
}
fmt.Printf("Setting up %s on %s...\n", name, ac.Host)

View file

@ -2,6 +2,7 @@
package agent
import (
"errors"
"fmt"
"maps"
@ -123,7 +124,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("agentci.RemoveAgent: no agents configured")
return errors.New("agentci.RemoveAgent: no agents configured")
}
if _, ok := agents[name]; !ok {
return fmt.Errorf("agentci.RemoveAgent: agent %q not found", name)

View file

@ -3,6 +3,7 @@ package jobrunner
import (
"bufio"
"encoding/json"
"errors"
"fmt"
"iter"
"os"
@ -54,7 +55,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.NewJournal: base directory is required")
return nil, errors.New("journal.NewJournal: base directory is required")
}
return &Journal{baseDir: baseDir}, nil
}
@ -121,10 +122,10 @@ func (j *Journal) ReadEntries(path string) iter.Seq2[JournalEntry, 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("journal.Append: signal is required")
return errors.New("journal.Append: signal is required")
}
if result == nil {
return fmt.Errorf("journal.Append: result is required")
return errors.New("journal.Append: result is required")
}
entry := JournalEntry{