← スキル一覧に戻る

go-dev
by MrPointer
My personal dotfiles
⭐ 2🍴 0📅 2026年1月23日
SKILL.md
name: go-dev description: General Go development guide. Use when writing Go code, implementing best practices, formatting code, writing tests, using mocks, handling errors, or understanding Go coding conventions. Covers code style, testing patterns, dependency injection, interface design, and performance optimization. Project-agnostic guidelines applicable to any Go codebase.
Go Development Guide
General-purpose Go development guidelines and best practices.
Core Principles
- Write effective Go code (see
effective-goskill for reference) - Use the Go standard library whenever possible
- Limit line length to 120 characters
- Write testable code using interfaces and dependency injection
- Wrap OS operations in interfaces for mockability
Code Organization
- Add interface verification after struct definitions:
var _ Interface = (*Struct)(nil) - Provide
NewStructNameconstructors for all structs - Always use dependency injection in constructors
- Pre-allocate collections when size is known
Optional Types
Use samber/mo for safer nil handling:
import "github.com/samber/mo"
type Config struct {
Shell mo.Option[string]
}
if shell, ok := config.Shell.Get(); ok {
// use shell
}
Testing
- Use
testifylibrary withrequirefor assertions - Name tests descriptively:
Test_<DescriptiveStatement> - Use table-driven tests for multiple scenarios
- Generate mocks with
mockery(moq template) - never edit manually - Check errors by keywords, not full message matching
Detailed References
For all coding conventions and patterns: See Code Style Reference
For all testing conventions: See Test Style Reference
スコア
総合スコア
50/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です