Merge pull request 'chore: Go 1.26 modernization' (#3) from chore/go-1.26-modernization into main
All checks were successful
Security Scan / security (push) Successful in 12s
Test / test (push) Successful in 5m53s

This commit is contained in:
Charon 2026-02-24 18:01:49 +00:00
commit 67d7ebec58
3 changed files with 8 additions and 6 deletions

View file

@ -5,13 +5,13 @@ package tasks
import ( import (
"context" "context"
"os" "os"
"sort" "slices"
"strings" "strings"
"time" "time"
"forge.lthn.ai/core/cli/pkg/cli"
"forge.lthn.ai/core/go-agentic" "forge.lthn.ai/core/go-agentic"
"forge.lthn.ai/core/go-ai/ai" "forge.lthn.ai/core/go-ai/ai"
"forge.lthn.ai/core/cli/pkg/cli"
"forge.lthn.ai/core/go/pkg/i18n" "forge.lthn.ai/core/go/pkg/i18n"
) )
@ -154,8 +154,8 @@ var taskCmd = &cli.Command{
agentic.PriorityLow: 3, agentic.PriorityLow: 3,
} }
sort.Slice(tasks, func(i, j int) bool { slices.SortFunc(tasks, func(a, b agentic.Task) int {
return priorityOrder[tasks[i].Priority] < priorityOrder[tasks[j].Priority] return priorityOrder[a.Priority] - priorityOrder[b.Priority]
}) })
task = &tasks[0] task = &tasks[0]

View file

@ -23,6 +23,7 @@ package workspace
import ( import (
"encoding/json" "encoding/json"
"errors"
"fmt" "fmt"
"path/filepath" "path/filepath"
"strings" "strings"
@ -92,7 +93,7 @@ func agentContextPath(wsPath, provider, name string) string {
func parseAgentID(id string) (provider, name string, err error) { func parseAgentID(id string) (provider, name string, err error) {
parts := strings.SplitN(id, "/", 2) parts := strings.SplitN(id, "/", 2)
if len(parts) != 2 || parts[0] == "" || parts[1] == "" { if len(parts) != 2 || parts[0] == "" || parts[1] == "" {
return "", "", fmt.Errorf("agent ID must be provider/agent-name (e.g. claude-opus/qa)") return "", "", errors.New("agent ID must be provider/agent-name (e.g. claude-opus/qa)")
} }
return parts[0], parts[1], nil return parts[0], parts[1], nil
} }

View file

@ -1,6 +1,7 @@
package workspace package workspace
import ( import (
"errors"
"fmt" "fmt"
"os" "os"
"path/filepath" "path/filepath"
@ -99,5 +100,5 @@ func FindWorkspaceRoot() (string, error) {
dir = parent dir = parent
} }
return "", fmt.Errorf("not in a workspace") return "", errors.New("not in a workspace")
} }