Skip to content

Commit 5526475

Browse files
authored
Merge pull request #404 from LLM-Coding/copilot/add-effective-go-term
Add "Effective Go" semantic anchor
2 parents 55414a6 + a1f0efd commit 5526475

4 files changed

Lines changed: 74 additions & 0 deletions

File tree

docs/anchors/effective-go.adoc

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
= Effective Go
2+
:categories: development-workflow
3+
:roles: software-developer, software-architect
4+
:proponents: The Go Authors
5+
:tags: go, golang, best-practices, idiomatic, style-guide
6+
:tier: 3
7+
8+
[%collapsible]
9+
====
10+
11+
[discrete]
12+
== *Core Concepts*:
13+
14+
Formatting (gofmt):: Code is auto-formatted; style debates are eliminated by tooling
15+
16+
Package names:: Short, lowercase, no underscores; package name is part of the qualified identifier
17+
18+
Named return values:: Return values can be named and used as documentation
19+
20+
Defer:: Deferred function calls run in LIFO order when the surrounding function returns; used for cleanup (close, unlock)
21+
22+
Goroutines:: Lightweight concurrently executing functions; "Don't communicate by sharing memory; share memory by communicating"
23+
24+
Channels:: Typed conduits for goroutine communication; first-class synchronization primitive
25+
26+
Interfaces:: Implicit satisfaction — a type implements an interface simply by implementing its methods; enables duck typing
27+
28+
Error handling:: Errors are values; idiomatic pattern is `if err != nil` at each call site; no exceptions
29+
30+
Blank identifier (_):: Discard unwanted values from multi-value returns without compiler error
31+
32+
Embedding:: Composition over inheritance; types can embed other types to gain their methods
33+
34+
Key Proponent:: The Go Authors (https://go.dev/doc/effective_go)
35+
36+
[discrete]
37+
== *When to Use*:
38+
39+
* Onboarding new Go developers to idiomatic Go style
40+
* Code review discussions about Go conventions
41+
* Establishing team-wide Go coding standards
42+
* Explaining Go idioms that differ from other languages (e.g. error handling, interfaces)
43+
* Prompting an LLM to produce idiomatic, production-quality Go code
44+
45+
====

skill/semantic-anchor-translator/references/catalog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,10 @@ Source: https://github.com/LLM-Coding/Semantic-Anchors
328328
- **Proponents:** Benjamin E. Coe, James J. Womack, Steve Mao
329329
- **Core:** Structured commit messages: type(scope): description
330330

331+
### Effective Go
332+
- **Proponents:** The Go Authors
333+
- **Core:** Official guide to idiomatic Go — gofmt formatting, short package names, defer for cleanup, goroutines and channels for concurrency ("share memory by communicating"), implicit interface satisfaction, error-as-value pattern, blank identifier, embedding over inheritance
334+
331335
### Semantic Versioning (SemVer)
332336
- **Core:** MAJOR.MINOR.PATCH — breaking, feature, fix
333337

website/public/data/anchors.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,30 @@
441441
"filePath": "docs/anchors/ears-requirements.adoc",
442442
"tier": 3
443443
},
444+
{
445+
"id": "effective-go",
446+
"title": "Effective Go",
447+
"categories": [
448+
"development-workflow"
449+
],
450+
"roles": [
451+
"software-developer",
452+
"software-architect"
453+
],
454+
"related": [],
455+
"proponents": [
456+
"The Go Authors"
457+
],
458+
"tags": [
459+
"go",
460+
"golang",
461+
"best-practices",
462+
"idiomatic",
463+
"style-guide"
464+
],
465+
"filePath": "docs/anchors/effective-go.adoc",
466+
"tier": 3
467+
},
444468
{
445469
"id": "event-driven-architecture",
446470
"title": "Event-Driven Architecture",

website/public/data/categories.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
"bem-methodology",
7575
"conventional-commits",
7676
"definition-of-done",
77+
"effective-go",
7778
"github-flow",
7879
"mental-model-according-to-naur",
7980
"mikado-method",

0 commit comments

Comments
 (0)