golang-error-handling

검토 · 73
Registry 색인

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 ma

Verified installs0
스타3.0K
버전1.0.0
품질82/100 · 강함
신뢰73/100 · 샌드박스 전용
감사85/100 · 안전하게 시도 가능

공급 자산 프로필

코딩 및 개발 Agent

코드 리뷰, 저장소 분석, 테스트, CI, GitHub, DevOps 및 개발 워크플로용 스킬입니다.

트랙 보기

시나리오

코딩 Agent

저장소를 이해하고 코드를 수정하며 Pull Request를 검토할 수 있는 코딩 Agent가 필요합니다.

Agent 적합도

Claude Code + OpenAI Agents + CLI

Codex, Claude Code, Cursor, CLI 또는 맞춤형 Agent에 적합합니다.

설치

준비됨

npx skills add samber/cc-skills-golang --skill golang-error-handling

유지보수

최신

마지막 푸시 후 2일

위험

안전하게 시도 가능

Quality score needs review

GitHub 품질

3.0K

82/100 품질 · 81/100 신뢰

커버리지 태그

코딩코딩 Agent리서치agent-skill

검토 메모

Quality score needs review

Agent 채택 스코어카드

신뢰, 감사, 설치 준비 상태를 한눈에 확인하세요

이 점수는 공개 저장소 메타데이터, OpenAgentSkill 검토 신호, 유지보수 최신성, 설치 준비 상태를 결합합니다. 후보 선정 신호일 뿐, 사람의 검토를 대체하지 않습니다.

품질

강함
82

프로덕션 워크플로 후보군에 넣을 만한 탄탄한 선택입니다.

신뢰

샌드박스 전용
73

신뢰 신호가 부족하거나 혼재된 유용한 후보입니다. 결과 루프가 작업 적합성을 입증할 때까지 격리된 작업 공간에서 사용하세요.

감사

안전하게 시도 가능
85

설치 준비 상태, 보안 메타데이터, 유지보수 및 채택 위험에 대한 기계 판독형 검토입니다.

OpenAgentSkill 신뢰 점수 v5

설치 전 사람 검토

실제 작업에 사용하기 전 샌드박스에서만 실행하고 유사 대안과 비교하세요.

CodexClaude CodeCursorOpenAgentSkill CLI

스타

GitHub 스타 3.0K

저장소 활동

스타 3.0K, 포크 197

유지보수

마지막 푸시 후 2일

라이선스

MIT

설치

npx skills add samber/cc-skills-golang --skill golang-error-handling

설치 안전성

표준 패키지 또는 런타임 설치 경로

권한 범위

shell or command execution, network or browser access

Agent 결과

아직 Agent 결과 데이터가 없습니다

문서

README/SKILL.md 맥락이 충분합니다

위험 요약

프로덕션 전 검토

  • Quality score needs review

설치 준비 상태

설치 경로 사용 가능

  • 설치 경로를 사용할 수 있습니다
  • 저장소 근거를 사용할 수 있습니다
  • 라이선스가 명시되었습니다
  • 아직 Agent 검증 결과 근거가 없습니다

Agent 읽기용 메타데이터

이 스킬의 기계 판독형 의사결정 데이터.

이 블록 또는 포함된 JSON을 사용해 Agent가 이 스킬을 설치할지, 대안을 고를지, 먼저 사람의 검토를 요청할지 판단할 수 있습니다.

JSON 열기

적합한 작업

  • 코딩 Agent 워크플로
  • Claude Code 팀
  • GitHub 채택 신호를 중시하는 팀
  • Inspect source files

적합한 Agent

CodexClaude CodeCursorOpenAgentSkill CLIOpenAI AgentsCLI

설치 결정

명령어
npx skills add samber/cc-skills-golang --skill golang-error-handling
정책
검토
사람 검토

신뢰와 위험

신뢰
73/100
감사
85/100
위험 수준
안전하게 시도 가능

결과 루프

엔드포인트
/api/agent/outcome
이벤트 ID
resolve
결과
5

설치 명령어

npx skills add samber/cc-skills-golang --skill golang-error-handling

사용하지 말아야 할 경우

  • 벤더 지원 SLA가 필요한 팀
  • 내부 보안 검토가 없는 고규정 준수 환경
  • 현재 메타데이터에서 주요 위험 신호가 발견되지 않았습니다
  • 고위험 권한 힌트: Shell 또는 명령 실행
  • Quality score needs review

Agent 안전 v2

61/100 · 설치 전 검토

권한 메모와 함께 검토됨검토

사용 가능한 후보이지만 Agent는 설치 전에 권한과 감사 메모를 표시해야 합니다.

실제 작업 공간에 설치하기 전에 사람의 승인이 필요합니다.

API로 해결

높음

Shell 또는 명령 실행

Skill 메타데이터가 터미널, CLI, Shell, 하위 프로세스 또는 명령 실행 워크플로를 참조합니다.

중간

네트워크 접근

Skill은 원격 페이지, API, 저장소 또는 외부 서비스에 접근할 수 있습니다.

  • 고위험 권한 힌트: Shell 또는 명령 실행
  • Quality score needs review

설치 대상

Agent 워크플로에 이 스킬 설치

공개 설치 엔드포인트에서 명령어, 안전 체크리스트, 대상 프롬프트와 정규 링크를 가져옵니다.

skill install

OpenAgentSkill CLI

Resolve policy, run the source installer safely, and report a verified install receipt.

$ npx --yes https://github.com/Leon-Drq/openagentskill/releases/download/cli-v0.2.1/openagentskill-0.2.1.tgz install samber-golang-error-handling

Agent 해결 계획

설치 전에 Agent가 적합성을 검증하게 하세요.

Resolve API는 최우선 스킬, 대안, 안전 정책, 감사 메모, 설치 대상 및 Agent가 페이지를 스크래핑하지 않고 사용할 수 있는 프롬프트를 반환합니다.

텍스트 계획 열기

Agent가 확인할 항목

  • Resolve API에서 작업 적합도와 대안을 확인합니다.
  • 감사 점수, 신뢰 점수 및 안전 정책 경고를 확인합니다.
  • Codex, Claude Code, Cursor 또는 CLI의 설치 대상 호환성을 확인합니다.

프롬프트 복사

Task: Use golang-error-handling in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20golang-error-handling%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/samber-golang-error-handling/install
Install command: npx skills add samber/cc-skills-golang --skill golang-error-handling
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.

Agent 핸드오프

또 다른 디렉터리 페이지 대신 설치 경로를 Agent에게 제공합니다.

공개 설치 엔드포인트에서 명령어, 안전 체크리스트, 대상 프롬프트와 정규 링크를 가져옵니다.

설치 API 열기

Agent 프롬프트

Use golang-error-handling for this task. Review https://www.openagentskill.com/api/skills/samber-golang-error-handling/install, then install with: npx skills add samber/cc-skills-golang --skill golang-error-handling

Registry 메타데이터

자동 스킬 선택을 위한 Agent 읽기용 프로필.

Registry API를 통해 동일한 결정, 신뢰, 감사, 사용 사례, 설치 신호를 제공하므로 Agent가 UI를 스크래핑하지 않고도 순위를 매길 수 있습니다.

Manifest 열기

Agent 적합도

95/100

코딩 Agent

플랫폼

Claude Code, OpenAI Agents

감사 보고서

안전하게 시도 가능 · 85/100

설치 준비 상태, 보안 메타데이터, 유지보수 및 채택 위험에 대한 기계 판독형 검토입니다.

감사 보고서 보기평가 보고서 보기

Agent 결정 패널

코딩 Agent용 우선 추천

우선 후보로 사용하되, 자신의 Agent 환경에서 README와 설치 경로를 검증하세요.

95
준비 상태
채택
단계

스택 내 역할

우선 추천

주요 적합도

코딩 Agent

신뢰 라벨

프로덕션 준비 완료

설치 경로

명령어 준비됨

사용 시점

  • 코딩 Agent 워크플로
  • Claude Code 팀
  • GitHub 채택 신호를 중시하는 팀

근거

  • GitHub 스타 3,022
  • 최근 저장소 활동
  • 설치 명령 또는 GitHub 저장소를 사용할 수 있습니다
  • 품질 프로필 82/100
  • OpenAgentSkill 상호작용 6건

먼저 검토

  • 현재 메타데이터에서 주요 위험 신호가 발견되지 않았습니다

구현 경로

  1. 1샌드박스 Agent에 설치하고 코딩 Agent 작업을 처음부터 끝까지 한 번 실행하세요.
  2. 2Compare output quality, latency, and failure behavior against at least one alternative.
  3. 3Promote it into production only after reviewing repository permissions, license, and maintenance signals.

신뢰 프로필

샌드박스 전용

신뢰 신호가 부족하거나 혼재된 유용한 후보입니다. 결과 루프가 작업 적합성을 입증할 때까지 격리된 작업 공간에서 사용하세요.

73
OpenAgentSkill 신뢰 점수

GitHub 채택도

통과

GitHub 스타 3.0K

스타/포크 활동

정보

스타 3.0K, 포크 197; 현재 메타데이터에서 이슈 활동을 확인할 수 없습니다

최근 유지보수

통과

마지막 푸시 후 2일

라이선스 명확성

통과

MIT

긍정 신호

  • AI 검토 승인됨
  • 설치 경로를 사용할 수 있습니다
  • 저장소 근거를 사용할 수 있습니다
  • 최근 유지보수된 저장소
  • 의미 있는 GitHub 채택 신호
  • 설치 명령에서 뚜렷한 고위험 패턴이 발견되지 않았습니다
  • 결과 루프는 준비되었지만 첫 실제 Agent 실행이 필요합니다

설치 전 검토

  • Quality score needs review
  • 아직 실제 Agent 결과 보고서가 없습니다
  • 무인 설치 전에 사람 검토가 필요합니다

권장 작업

실제 작업에 사용하기 전 샌드박스에서만 실행하고 유사 대안과 비교하세요.

품질 프로필

강함 Agent 워크플로용 후보

프로덕션 워크플로 후보군에 넣을 만한 탄탄한 선택입니다.

82
GitHub 스타
3.0K
최신성
2일 전
설치 준비됨
라이선스
MIT

워크플로 적합도

이 스킬을 사용할 시나리오

워크플로 적합도

완전한 워크플로에 추가

대안 후보

설치 전 비교

이 작업에 적합할 수 있는 유사 스킬입니다.

모두 비교

개요

--- 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." user-invocable: true license: MIT compatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang. metadata: author: samber version: "1.3.0" openclaw: emoji: "⚠" homepage: https://github.com/samber/cc-skills-golang requires: bins: - go install: [] allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent paths: - "**/*.go" ---

**Persona:** You are a Go reliability engineer. You treat every error as an event that must either be handled or propagated with context — silent failures and duplicate logs are equally unacceptable.

**Orchestration mode:** Fan out the five category sub-agents described in the "Parallelizing Error Handling Audits" section (creation, wrapping, single-handling rule, panic/recover, structured logging) for auditing error handling across a large codebase, and consolidate their findings. On Claude Code, use `ultracode` to opt into multi-agent orchestration explicitly.

**Modes:**

- **Coding mode** — writing new error handling code. Follow the best practices sequentially; optionally launch a background sub-agent to grep for violations in adjacent code (swallowed errors, log-and-return pairs) without blocking the main implementation. - **Review mode** — reviewing a PR's error handling changes. Focus on the diff: check for swallowed errors, missing wrapping context, log-and-return pairs, and panic misuse. Sequential. - **Audit mode** — auditing existing error handling across a codebase. Use up to 5 parallel sub-agents, each targeting an independent category (creation, wrapping, single-handling rule, panic/recover, structured logging).

> **Community default.** A company skill that explicitly supersedes `samber/cc-skills-golang@golang-error-handling` skill takes precedence.

# Go Error Handling Best Practices

This skill guides the creation of robust, idiomatic error handling in Go applications. Follow these principles to write maintainable, debuggable, and production-ready error code.

## Best Practices Summary

1. **Returned errors MUST always be checked** — NEVER discard with `_` 2. **Errors MUST be wrapped with context** using `fmt.Errorf("{context}: %w", err)` 3. **Error strings MUST be lowercase**, without trailing punctuation 4. **Use `%w` internally, `%v` at system boundaries** to control error chain exposure 5. **MUST use `errors.Is` for sentinel matching and `errors.As`/`errors.AsType` for typed chain inspection** instead of direct comparison or bare type assertions. For Go 1.26+, prefer `errors.AsType[T](err)` when `T` implements `error`; use `errors.As(err, &target)` for Go <1.26 or for non-error interface targets. 6. **SHOULD use `errors.Join`** (Go 1.20+) to combine independent errors 7. **Errors MUST be either logged OR returned**, NEVER both (single handling rule) 8. **Use sentinel errors** for expected conditions, custom types for carrying data 9. **NEVER use `panic` for expected error conditions** — reserve for truly unrecoverable states 10. **SHOULD use `slog`** (Go 1.21+) for structured error logging — not `fmt.Println` or `log.Printf` 11. **Use `samber/oops`** for production errors needing stack traces, user/tenant context, or structured attributes 12. **Log HTTP requests** with structured middleware capturing method, path, status, and duration 13. **Use log levels** to indicate error severity 14. **Never expose technical errors to users** — translate internal errors to user-friendly messages, log technical details separately 15. **Keep log grouping low-cardinality** — at logging/APM boundaries, keep message templates stable and attach IDs, paths, line numbers, and counts as structured attributes. Error values may include useful operational context, but avoid putting high-cardinality data into the stable log message used for grouping.

## Detailed Reference

- **[Error Creation](./references/error-creation.md)** — How to create errors that tell the story: error messages should be lowercase, no punctuation, and describe what happened without prescribing action. Covers sentinel errors (one-time preallocation for performance), custom error types (for carrying rich context), and the decision table for which to use when.

- **[Error Wrapping and Inspection](./references/error-wrapping.md)** — Why `fmt.Errorf("{context}: %w", err)` beats `fmt.Errorf("{context}: %v", err)` (chains vs concatenation). How to inspect chains with `errors.Is`, `errors.As`, and Go 1.26+ `errors.AsType` for type-safe error handling, and `errors.Join` for combining independent errors.

- **[Error Handling Patterns and Logging](./references/error-handling.md)** — The single handling rule: errors are either logged OR returned, NEVER both (prevents duplicate logs cluttering aggregators). Panic/recover design, `samber/oops` for production errors, and `slog` structured logging integration for APM tools.

## Parallelizing Error Handling Audits

When auditing error handling across a large codebase, use up to 5 parallel sub-agents — each targets an independent error category:

- Sub-agent 1: Error creation — validate `errors.New`/`fmt.Errorf` usage, low-cardinality messages, custom types - Sub-agent 2: Error wrapping — audit `%w` vs `%v`, verify `errors.Is`/`errors.As` patterns - Sub-agent 3: Single handling rule — find log-and-return violations, swallowed errors, discarded errors (`_`) - Sub-agent 4: Panic/recover — audit `panic` usage, verify recovery at goroutine boundaries - Sub-agent 5: Structured logging — verify `slog` usage at error sites, check for PII in error messages

## Cross-References

- → See `samber/cc-skills-golang@golang-samber-oops` for full samber/oops API, builder patterns, and logger integration - → See `samber/cc-skills-golang@golang-observability` for structured logging setup, log levels, and request logging middleware - → See `samber/cc-skills-golang@golang-safety` for nil interface trap and nil error comparison pitfalls - → See `samber/cc-skills-golang@golang-naming` for error naming conventions (ErrNotFound, PathError) - → See `samber/cc-skills-golang@golang-continuous-integration` skill for automated AI-driven code review in CI using these guidelines

## References

- [lmittmann/tint](https://github.com/lmittmann/tint) - [samber/oops](https://github.com/samber/oops) - [samber/slog-multi](https://github.com/samber/slog-multi) - [samber/slog-sampling](https://github.com/samber/slog-sampling) - [samber/slog-formatter](https://github.com/samber/slog-formatter) - [samber/slog-http](https://github.com/samber/slog-http) - [samber/slog-sentry](https://github.com/samber/slog-sentry) - [log/slog package](https://pkg.go.dev/log/slog)

기술 세부 사항

버전
1.0.0
라이선스
MIT
최근 업데이트
2026년 8월 21일
게시일
2026년 8월 21일

결정 스냅샷

우선 추천

95
준비됨
채택
단계

GitHub 스타 3,022

감사

설치 검토

설치 및 채택 검토

85
안전하게 시도 가능
보안
83/100
유지보수
100/100
설치
92/100
전체 감사 열기평가 보고서 보기

Agent 검증 증거

Agent 검증 증거

Resolve, 검토, 설치 및 한 번의 제한된 실행 후 결과 보고서입니다.

0
검증됨
Needs first agent run자동 설치: 먼저 검토최근: 알 수 없음
성공률
최근 실패
결과
0
출력 품질
실패
0
관련 없음
0
설치
0
위험 차단
0
설정 필요
0
프로덕션
0

아직 Agent 결과 데이터가 없습니다. 첫 실행은 /api/agent/outcome을 통해 성공, 설정 필요, 위험 차단, 실패 또는 비관련 결과를 보고할 수 있습니다.

설치

Agent 워크플로에 추가

무료 오픈 소스. 프로덕션 Agent에 설치하기 전에 보고서를 검토하세요.

성장 루프

공유 키트

X

golang-error-handling용 시나리오 기반 초안입니다. X에 수동으로 게시할 수 있습니다.

큐레이터 노트
golang-error-handling: Idiomatic Golang error handling — creation, wrapping with %w, errors.Is/As, errors.Join, cust...

3.0K stars

https://www.openagentskill.com/skills/samber-golang-error-handling?ref=x
X 초안 열기
선택 사항: 설치 명령이 포함된 답글
Listing + install path for golang-error-handling:
https://www.openagentskill.com/skills/samber-golang-error-handling?ref=x

Install: npx skills add samber/cc-skills-golang --skill golang-error-handling

등록 출처

Registry 색인

소유권 주장 가능

이 등록은 공개 소스에서 색인되었으며 유지보수자 소유권 주장이 승인될 때까지 공식으로 표시되지 않습니다.

제작자
samber
색인 주체
OpenAgentSkill 커뮤니티 인덱스

귀속은 공개 저장소 또는 제작자 프로필에 연결됩니다. 제작자는 등록을 주장하여 소유권 신호를 업데이트할 수 있습니다.

이 스킬 소유권 주장

소유자 소유권 주장

이 스킬 등록 소유권 주장

이 Registry 색인 등록은 samber에게 귀속되어 있지만 아직 공식으로 표시되지 않았습니다. 소유권을 주장하면 확인된 소유자 신호가 추가되어 이후 출시, 설치 및 감사 업데이트를 더 신뢰할 수 있습니다.

크리에이터 백링크 키트

README에 증거 배지 추가

개발자가 저장소를 평가하는 위치에 정규 등록, 현재 신뢰 및 감사 신호, 실제 Agent-Proven 증거를 표시합니다.

[![Listed on OpenAgentSkill](https://www.openagentskill.com/api/badge/samber-golang-error-handling?metric=listed&label=Listed)](https://www.openagentskill.com/skills/samber-golang-error-handling)
[![OpenAgentSkill Trust](https://www.openagentskill.com/api/badge/samber-golang-error-handling?metric=trust&label=Trust)](https://www.openagentskill.com/skills/samber-golang-error-handling)
[![OpenAgentSkill Audit](https://www.openagentskill.com/api/badge/samber-golang-error-handling?metric=audit&label=Audit)](https://www.openagentskill.com/skills/samber-golang-error-handling/audit)
[![Agent Proven](https://www.openagentskill.com/api/badge/samber-golang-error-handling?metric=proven&label=Agent%20Proven)](https://www.openagentskill.com/skills/samber-golang-error-handling)

작성자

S

samber

@samber

플랫폼 적합도

상태 신호

GitHub 스타
3.0K
품질 점수
48/100
최근 GitHub 푸시
2026년 8월 21일
프레임워크 힌트
알 수 없음
OpenAgentSkill 조회수
6
설치 명령 복사
0
외부 클릭
0

커뮤니티 신호

이 스킬이 Agent 워크플로에 유용한지 알려 주세요. 집계된 피드백은 시간이 지날수록 순위를 개선합니다.

신뢰와 안전

샌드박스 전용

73
  • GitHub 채택도GitHub 스타 3.0K통과
  • 스타/포크 활동스타 3.0K, 포크 197; 현재 메타데이터에서 이슈 활동을 확인할 수 없습니다정보
  • 최근 유지보수마지막 푸시 후 2일통과
  • 라이선스 명확성MIT통과
  • README/SKILL.md 완성도메타데이터에 충분한 사용 및 워크플로 맥락이 포함되어 있습니다통과
  • 의존성/런타임 위험command execution surface, network or browser surface정보