# Std Go

> 提供 Go 编码规范（基于 Google Go Style Guide）。当编写或 review Go 代码（.go 文件）时使用。

- **Type:** Skill
- **Install:** `agentstack add skill-davidyichengwei-agentic-engineering-framework-std-go`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [davidYichengWei](https://agentstack.voostack.com/s/davidyichengwei)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [davidYichengWei](https://github.com/davidYichengWei)
- **Source:** https://github.com/davidYichengWei/agentic-engineering-framework/tree/main/skills/std-go

## Install

```sh
agentstack add skill-davidyichengwei-agentic-engineering-framework-std-go
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Go 编码规范

> 基于 Google Golang 代码规范，结合实际工程经验进行了调整和补充。

## 规范等级定义

| 等级 | 定义 |
|------|------|
| **必须（Mandatory）** | 用户必须采用，代码扫描工具应将其视为错误 |
| **推荐（Preferable）** | 用户理应采用，但如有特殊情况可以不采用 |
| **可选（Optional）** | 用户可参考，自行决定是否采用 |

## 核心规则速查

| 类别 | 必须遵守 |
|------|----------|
| **格式化** | 使用 `gofmt` 格式化代码 |
| **import** | 使用 `goimports`，禁止相对路径导入，标准包在最上 |
| **错误处理** | 必须处理 `error`，`error` 必须是最后一个返回值 |
| **panic** | 禁止用于一般错误处理，仅用于不变量断言 |
| **命名** | 驼峰式，包名小写无下划线，文件名小写下划线分隔 |
| **注释** | 导出名字必须有文档注释，格式 `// Name 描述` |
| **switch** | 必须有 `default` 分支 |
| **goto** | 业务代码禁止使用 |
| **嵌套** | 深度不超过 4 层 |
| **代码行数** | 文件 ≤ 800 行，函数 ≤ 80 行 |
| **依赖管理** | 使用 `go modules` |

## 完整规范

详见 [reference/full-standards.md](reference/full-standards.md)，包含：
- 代码风格（格式化、换行、括号空格、import）
- 错误处理（error、panic、recover）
- 注释规范（包、结构体、方法、变量、常量、类型）
- 命名规范（包、文件、结构体、接口、变量、常量、函数）
- 控制结构（if、for、range、switch、return、goto）
- 函数规范（参数、defer、接收器、代码行数、嵌套、变量声明、魔法数字）
- 依赖管理和应用服务规范

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [davidYichengWei](https://github.com/davidYichengWei)
- **Source:** [davidYichengWei/agentic-engineering-framework](https://github.com/davidYichengWei/agentic-engineering-framework)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-davidyichengwei-agentic-engineering-framework-std-go
- Seller: https://agentstack.voostack.com/s/davidyichengwei
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
