golang-design-patterns
Design Idiomatic Go APIs and Architecture
Go services become harder to maintain when initialization, resource ownership, and architectural boundaries are unclear. This skill guides practical pattern selection with focused Go examples.
使用我的智慧代理安裝
將此請求複製給你的智慧代理,其中包含權威 Skill 頁面和清單。
Review the Skillstore skill "golang-design-patterns" from https://skillstore.io/skills/samber-golang-design-patterns.md and its manifest at https://skillstore.io/api/skills/samber-golang-design-patterns/manifest. Verify the artifact. You may proceed after verification, subject to the environment's own policy.你的智慧代理仍應顯示其計畫,並依安全政策請求必要確認。
Agent 可讀資源
當 AI Agent、爬蟲或腳本需要乾淨脈絡、而不是讀取完整頁面時,請使用這些連結。
測試它
正在使用「golang-design-patterns」。 What architecture should I use for a small CSV-processing CLI?
預期結果:
- Confirm team preferences and expected growth before adding layers.
- Use a flat layout with a small entry point and focused transformation functions.
- Introduce additional packages only when responsibilities or testing needs justify them.
正在使用「golang-design-patterns」。 Our service opens its database in init and has no shutdown deadline. What should change?
預期結果:
- Finding: Implicit database initialization hides dependencies and prevents normal error propagation.
- Recommendation: Open the database explicitly during startup and inject it into repositories.
- Finding: Shutdown can wait indefinitely without a separate deadline.
- Recommendation: Handle termination signals, drain requests with a timeout, then close shared resources.
正在使用「golang-design-patterns」。 How should Order and Billing communicate in a DDD application?
預期結果:
- Keep each bounded context responsible for its own domain model.
- Publish an order event and translate it into a billing-specific representation.
- Avoid importing another context's internal domain types directly.
安全審計
中風險All 89 static findings are false positives involving documentation syntax, ordinary Go constructs, illustrative configuration access, and homepage metadata. One semantic finding identifies internal errors returned directly to HTTP clients in two architecture examples. No evidence found of credential exfiltration, malicious command execution, or instructions to manipulate this audit.
已確認的安全問題 (1)
風險因素
⚙️ 外部命令 (50)
🔑 環境變數 (2)
🌐 網路存取 (1)
分享與引用此報告
分享版本化評估報告、中性徽章、嵌入卡片與引用。Skillstore 只報告證據,不判斷該 Skill 是否安全。
複製報告連結
https://skillstore.io/skills/samber-golang-design-patterns/audits/1?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_reportMarkdown 徽章
[](https://skillstore.io/skills/samber-golang-design-patterns?utm_source=security_passport_badge)HTML 徽章
<a href="https://skillstore.io/skills/samber-golang-design-patterns?utm_source=security_passport_badge"><img src="https://skillstore.io/badges/skills/samber-golang-design-patterns/security.svg" alt="Skillstore security assessment" loading="lazy"></a>嵌入卡片
<iframe src="https://skillstore.io/embed/skills/samber-golang-design-patterns.html" title="Skillstore Security Assessment" sandbox="allow-popups allow-popups-to-escape-sandbox" loading="lazy" referrerpolicy="no-referrer" width="420" height="180"></iframe>學術引用 (APA · BibTeX · CFF)
APA 引用
samber. (2026). golang-design-patterns security audit report (audit version 1) [Author version 1.2.1]. Skillstore. https://skillstore.io/skills/samber-golang-design-patterns/audits/1BibTeX 引用
@techreport{samber-samber-golang-design-patterns-2026,
author = {samber},
title = {golang-design-patterns security audit report (audit version 1)},
institution = {Skillstore},
year = {2026},
number = {1},
url = {https://skillstore.io/skills/samber-golang-design-patterns/audits/1},
note = {Author version 1.2.1}
}CITATION.cff
cff-version: 1.2.0
message: "If you use this Skill, cite its author and this versioned security audit report."
title: "golang-design-patterns security audit report (audit version 1)"
version: "1.2.1"
type: report
authors:
- name: "samber"
date-released: "2026-10-15"
url: "https://skillstore.io/skills/samber-golang-design-patterns/audits/1"
identifiers:
- type: other
value: "skillstore:samber-golang-design-patterns:audit:1"
description: "Skillstore immutable audit report identifier"
Skillstore 評分
評分依據 證據置信度: 中你可以打造什麼
Design an Extensible Constructor
Define defaults, optional settings, and validation behavior for a Go library API that will evolve.
Review Service Resource Lifecycles
Identify hidden initialization, missing timeouts, unbounded pools, and incomplete shutdown handling before changing a service.
Choose Application Boundaries
Compare architecture styles for a growing service with multiple entry points and external integrations.
試試這些提示
I am building a Go CLI that transforms a CSV file. It should remain small. Ask about my architecture preference, then recommend a minimal layout.
Design a Go server constructor with read timeout, write timeout, and maximum connections. Use explicit defaults and explain how invalid options return errors.
Review the attached Go service for implicit initialization, resource leaks, missing timeouts, and cancellation handling. Report findings first, then suggest focused changes and shutdown ordering.
Our Go order service has HTTP, gRPC, and message consumers with database and payment integrations. Ask about team preferences. Compare clean, hexagonal, and DDD approaches, including dependency direction and testability.
最佳實務
- State the Go version, project scope, and team architecture preferences before requesting design guidance.
- Keep resource ownership explicit and review cancellation, limits, and shutdown ordering together.
- Adapt illustrative examples to local conventions and verify behavior with focused tests and security review.
避免
- Adding clean architecture or DDD layers to a small CLI without a concrete need.
- Hiding runtime dependencies in init functions or mutable global variables.
- Copying illustrative handlers into production without validating error disclosure and project-specific security requirements.
常見問題
Which AI tools is this skill designed for?
Does it always recommend complex architecture?
Can it help review existing Go code?
Does it configure dependency injection frameworks?
Which Go versions do the newer examples require?
Are the examples ready for production without changes?
開發者詳細資訊
作者
samber授權
MIT
作者版本
v1.2.1
Skillstore 修訂
r1
引用
94747fbb9cfbe87f802b9786d767c047e503f359
維護新鮮度
2026/10/15
使用量
0 次下載 · 0 次瀏覽