mirror of
https://github.com/tiennm99/awesome-coding-agents.git
synced 2026-08-31 10:33:29 +00:00
* chore: project hardening — dep swap, CI gates, dependabot, action bumps - swap gopkg.in/yaml.v3 (upstream archived Apr 2025) for maintained github.com/goccy/go-yaml; same Unmarshal API, tags unchanged - add CI workflow: go vet/test/build + golangci-lint + govulncheck on PRs and main pushes - add dependabot for gomod + github-actions (weekly) - bump actions to latest majors in update.yml (clears Node 20 deprecation annotations); workflow logic untouched - README/history refreshed by E2E verification run (29 agents) * fix: check Close/Remove error returns (errcheck) Write paths (writeSnapshots, renderReadme) now propagate close errors — a failed close there can hide lost data. Read/cleanup paths ignore explicitly with _ =.
35 lines
651 B
Go
35 lines
651 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/goccy/go-yaml"
|
|
)
|
|
|
|
type Agent struct {
|
|
Owner string `yaml:"owner"`
|
|
Repo string `yaml:"repo"`
|
|
Category string `yaml:"category,omitempty"`
|
|
Notes string `yaml:"notes,omitempty"`
|
|
}
|
|
|
|
func loadAgents(path string) ([]Agent, error) {
|
|
data, err := os.ReadFile(path)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
var cfg struct {
|
|
Agents []Agent `yaml:"agents"`
|
|
}
|
|
if err := yaml.Unmarshal(data, &cfg); err != nil {
|
|
return nil, err
|
|
}
|
|
for i, a := range cfg.Agents {
|
|
if a.Owner == "" || a.Repo == "" {
|
|
return nil, fmt.Errorf("entry %d missing owner or repo", i)
|
|
}
|
|
}
|
|
return cfg.Agents, nil
|
|
}
|