SKILL

golang-patterns

Idiomatic Go patterns, best practices, and conventions for building robust, efficient, and maintainable Go applications.

Target: Target not categorized. Automatically collected · unverified.

Excerpt from the author’s documentation

Extracted from a fixed version of SKILL.md in its original language. This is the author’s documentation; installation, compatibility and runtime results have not been verified by this site.

Read the original Chinese text

Topics in the source

  • Go 開發模式
  • 何時啟用
  • 核心原則
  • 1. 簡單與清晰
  • 2. 讓零值有用
  • 3. 接受介面,回傳結構
  • 錯誤處理模式
  • 帶上下文的錯誤包裝

用於建構穩健、高效且可維護應用程式的慣用 Go 模式和最佳實務。 撰寫新的 Go 程式碼 審查 Go 程式碼 重構現有 Go 程式碼 設計 Go 套件/模組 Go 偏好簡單而非聰明。程式碼應該明顯且易讀。 設計類型使其零值無需初始化即可立即使用。 函式應接受介面參數並回傳具體類型。 | 慣用語 | 描述 | |-------|------| | 接受介面,回傳結構 | 函式接受介面參數,回傳具體類型 | | 錯誤是值 | 將錯誤視為一等值,而非例外 | | 不要透過共享記憶體通訊 | 使用 channel 在 goroutine 間協調 | | 讓零值有用 | 類型應無需明確初始化即可工作 | | 一點複製比一點依賴好 | 避免不必要的外部依賴 | | 清晰優於聰明 | 優先考慮可讀性而非聰明 | | gofmt 不是任何人的最愛但是所有人的朋友 | 總是用 gofmt/goimports 格式化 | | 提早返回 | 先處理錯誤,保持快樂路徑不縮排 | 記住:Go 程式碼應該以最好的方式無聊 - 可預測、一致且易於理解。有疑慮時,保持簡單。

Source repository
affaan-m/ECC
Source file
docs/zh-TW/skills/golang-patterns/SKILL.md
Fixed revision
d2ef2680594f9a17526a6e1a2e18b3d242c5d17b
Read the complete original documentation ↗

Requirements

  • Only the author’s Skill metadata is included. Read the full instructions to check dependencies, licensing and conditions of use.

A small first task

先阅读原作者说明,再决定是否在自己的 AI 工具中使用。

Instructions for your AI tool

Author documentation is not live verification by this site. Without evidence, we do not mark a resource as compatible, safe or free.

Sources and evidence

This record was collected automatically. Its documentation, suitability and runtime behavior have not been manually verified.

Author: affaan-m/ECC · original repository metadata. Documentation review: Not reviewed. Last source check: 2026-11-09T15:01:42.744Z.

Categories are inferred from names, descriptions and paths. They do not establish compatibility.

License and attribution

MIT. Third-party content and copyright remain with their authors. Refer to the original license and terms.

Original license ↗

Synchronization, copying and user-reported success do not mark a resource as runtime-tested.

Limitations and notes

  • Collecting metadata does not mean this site has installed, adapted, runtime-tested or security-reviewed the resource.