{"id":"21dc3f86-9296-44c2-a94f-60b2cb50082a","slug":"clawhub-samber-golang-error-handling","name":"golang-error-handling","description":"Idiomatic Golang error handling — creation, wrapping with %w, errors.Is/As, errors.Join, custom error types, sentinel errors, panic/recover, the single handling rule, structured logging with slog, HTTP request logging middleware, and samber/oops for production errors. Built to make logs usable at scale with log aggregation 3rd-party tools. Apply when creating, wrapping, inspecting, or logging errors in Go code. For samber/oops specifics → See `samber/cc-skills-golang@golang-samber-oops` skill; for slog handler ecosystem → See `samber/cc-skills-golang@golang-samber-slog` skill.","canonicalUrl":"https://www.xpersona.co/agent/clawhub-samber-golang-error-handling","sourceUrl":"https://clawhub.ai/samber/golang-error-handling","homepage":"https://clawhub.ai/samber/skills/golang-error-handling","source":"CLAWHUB","vendor":{"slug":"clawhub","label":"Clawhub","url":"https://clawhub.ai/samber/skills/golang-error-handling"},"protocols":["OPENCLEW"],"capabilities":[],"trustScore":null,"trustConfidence":"unknown","artifactCount":0,"benchmarkCount":0,"lastRelease":"1.3.0","freshnessAt":"2026-10-10T19:14:03.661Z","freshnessLabel":"Oct 10, 2026","securityReviewed":true,"openapiReady":false,"stats":[{"label":"Trust score","value":"Unknown"},{"label":"Compatibility","value":"OpenClaw"},{"label":"Freshness","value":"Oct 10, 2026"},{"label":"Vendor","value":"Clawhub"},{"label":"Artifacts","value":"0"},{"label":"Benchmarks","value":"0"},{"label":"Last release","value":"1.3.0"}],"factsPreview":[{"factKey":"vendor","category":"vendor","label":"Vendor","value":"Clawhub","href":"https://clawhub.ai/samber/skills/golang-error-handling","sourceUrl":"https://clawhub.ai/samber/skills/golang-error-handling","sourceType":"profile","confidence":"medium","observedAt":"2026-10-10T19:14:03.661Z","isPublic":true},{"factKey":"protocols","category":"compatibility","label":"Protocol compatibility","value":"OpenClaw","href":"https://www.xpersona.co/api/v1/agents/clawhub-samber-golang-error-handling/contract","sourceUrl":"https://www.xpersona.co/api/v1/agents/clawhub-samber-golang-error-handling/contract","sourceType":"contract","confidence":"medium","observedAt":"2026-10-10T19:14:03.661Z","isPublic":true},{"factKey":"traction","category":"adoption","label":"Adoption signal","value":"1.3K downloads","href":"https://clawhub.ai/samber/golang-error-handling","sourceUrl":"https://clawhub.ai/samber/golang-error-handling","sourceType":"profile","confidence":"medium","observedAt":"2026-10-10T19:14:03.661Z","isPublic":true},{"factKey":"latest_release","category":"release","label":"Latest release","value":"1.3.0","href":"https://clawhub.ai/samber/golang-error-handling","sourceUrl":"https://clawhub.ai/samber/golang-error-handling","sourceType":"release","confidence":"medium","observedAt":"2026-08-21T01:42:30.612Z","isPublic":true},{"factKey":"handshake_status","category":"security","label":"Handshake status","value":"UNKNOWN","href":"https://www.xpersona.co/api/v1/agents/clawhub-samber-golang-error-handling/trust","sourceUrl":"https://www.xpersona.co/api/v1/agents/clawhub-samber-golang-error-handling/trust","sourceType":"trust","confidence":"medium","observedAt":null,"isPublic":true}],"highlights":["1.3K downloads","Trust evidence available"],"agentCard":{"name":"golang-error-handling","description":"Idiomatic Golang error handling — creation, wrapping with %w, errors.Is/As, errors.Join, custom error types, sentinel errors, panic/recover, the single handling rule, structured logging with slog, HTTP request logging middleware, and samber/oops for production errors. Built to make logs usable at scale with log aggregation 3rd-party tools. Apply when creating, wrapping, inspecting, or logging errors in Go code. For samber/oops specifics → See `samber/cc-skills-golang@golang-samber-oops` skill; for slog handler ecosystem → See `samber/cc-skills-golang@golang-samber-slog` skill.","source":"CLAWHUB","sourceId":"clawhub:s173arkhs3131fq5jf769qq75583hdgt:golang-error-handling","homepage":"https://clawhub.ai/samber/skills/golang-error-handling","repository":"https://clawhub.ai/samber/golang-error-handling","documentation":"https://www.xpersona.co/agent/clawhub-samber-golang-error-handling","protocols":["OPENCLEW"],"examples":[{"kind":"example","language":"go","snippet":"type error interface {\n    Error() string\n}"},{"kind":"example","language":"go","snippet":"// ✗ Bad — silently discarding errors\ndata, _ := os.ReadFile(\"config.yaml\")\n\n// ✗ Bad — only checking in some branches\nresult, err := doSomething()\nfmt.Println(result) // using result without checking err\n\n// ✓ Good — always check before using other return values\ndata, err := os.ReadFile(\"config.yaml\")\nif err != nil {\n    return fmt.Errorf(\"reading config: %w\", err)\n}"}]}}