Files
awesome-coding-agents/agents.go
T
tiennm99andGitHub 5d66d4757c chore: project hardening — dep swap, CI gates, dependabot, action bumps (#8)
* 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 _ =.
2026-08-09 02:48:03 +07:00

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
}