Skip to content
Back to skills

Go Standard

ASecurity

Go 표준 라이브러리 기반 백엔드 컨벤션

  • 13 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added May 28, 2026
ai-agentsgotesting

Security analysis

A100/100

Scanned May 28, 2026

npx -y skills add ggombee/code-forge --skill go-standard --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Go Standard?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Go Standard
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ggombee-go-standard/badge)](https://www.skillsdirectory.com/skills/ggombee-go-standard)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: go-standard
description: Go 표준 라이브러리 기반 백엔드 컨벤션
---

# Go 표준 라이브러리 컨벤션

## 프로젝트 구조

```
cmd/
└── server/
    └── main.go      # 진입점
internal/            # 외부 노출 불가 패키지
├── handler/         # HTTP 핸들러
├── service/         # 비즈니스 로직
├── repository/      # 데이터 접근 레이어
└── model/           # 도메인 모델
pkg/                 # 외부 공유 가능 패키지
go.mod
go.sum
```

## 네이밍 규칙

- 패키지명: 소문자 단어 (예: `handler`, `repository`)
- 파일명: `snake_case.go`
- exported: `PascalCase`, unexported: `camelCase`
- 인터페이스: 동작 기반 이름 (예: `UserStore`, `Notifier`)
- 에러 변수: `Err` 접두사 (예: `ErrNotFound`)

## 에러 처리

- `fmt.Errorf("...: %w", err)` 로 에러 래핑
- `errors.Is` / `errors.As` 로 타입 확인
- 핸들러에서만 HTTP 상태로 변환, 내부 레이어는 순수 에러 반환
- sentinel 에러는 패키지 레벨에 `var ErrXxx = errors.New(...)` 정의

## 테스트

- `testing` 표준 패키지 + `testify/assert` 조합
- 인터페이스 기반 mock (`mockery` 또는 수동 mock)
- 테이블 기반 테스트(`t.Run`) 적극 활용
- 통합 테스트는 `_integration_test.go` 파일로 분리, `-tags integration` 빌드 태그 사용

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.