chore: fmt.Errorf(static) → errors.New
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
cacc1ab3c8
commit
da9c133f1f
2 changed files with 6 additions and 4 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue