You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(go): add Go standards page and update language matrix
Add content/docs/standards/go.md covering golangci-lint, gofumpt,
govulncheck, and go test. Update _index.md with Go column in matrix,
target mapping, and per-language list.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: content/docs/standards/_index.md
+15-14Lines changed: 15 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: "Standards"
3
3
linkTitle: "Standards"
4
4
weight: 20
5
-
description: "Per-language tooling standards for Python, Bash, Terraform, Ansible, Ruby, and universal security tools."
5
+
description: "Per-language tooling standards for Python, Bash, Terraform, Ansible, Ruby, Go, and universal security tools."
6
6
---
7
7
8
8
DevRail defines opinionated tooling standards for each supported language ecosystem. Every tool is pre-installed in the dev-toolchain container and invoked through consistent Makefile targets.
@@ -11,15 +11,15 @@ DevRail defines opinionated tooling standards for each supported language ecosys
11
11
12
12
The following table shows the default tool for each concern per language. These tools are pre-installed in the `dev-toolchain` container.
| Formatter | gofumpt | Strict superset of gofmt |
16
+
| Security | govulncheck | Scans module dependencies for known vulnerabilities |
17
+
| Tests | go test | Built-in Go test runner |
18
+
19
+
All tools are pre-installed in the dev-toolchain container. Do not install them on the host.
20
+
21
+
## Configuration
22
+
23
+
### golangci-lint
24
+
25
+
Config file: `.golangci.yml` at repository root.
26
+
27
+
```yaml
28
+
# .golangci.yml -- DevRail Go lint configuration
29
+
version: "2"
30
+
31
+
linters:
32
+
enable:
33
+
- errcheck
34
+
- govet
35
+
- staticcheck
36
+
- gosec
37
+
- ineffassign
38
+
- unused
39
+
- gocritic
40
+
- gofumpt
41
+
- misspell
42
+
- revive
43
+
44
+
issues:
45
+
exclude-dirs:
46
+
- vendor
47
+
- node_modules
48
+
```
49
+
50
+
golangci-lint v2 uses a `version: "2"` key in the config file. It is a meta-linter that bundles dozens of linters. Do not install standalone versions of go vet, staticcheck, gosec, or errcheck.
51
+
52
+
### gofumpt
53
+
54
+
No config file required. gofumpt is a strict superset of `gofmt`. It enforces additional formatting rules (grouped imports, consistent spacing). Run with `gofumpt -w .` to apply fixes or `gofumpt -d .` to check.
55
+
56
+
### govulncheck
57
+
58
+
No config file required. Scans `go.sum` for known vulnerabilities in module dependencies. Requires the Go SDK at runtime because it uses `go/packages` internally.
59
+
60
+
## Makefile Targets
61
+
62
+
| Target | Command | Description |
63
+
|---|---|---|
64
+
| `make lint` | `golangci-lint run ./...` | Lint all Go files |
- **golangci-lint v2 is the single linting tool.** It bundles go vet, staticcheck, gosec, errcheck, and dozens more. Do not install standalone versions of these linters.
92
+
- **gofumpt is a strict superset of gofmt.** All gofmt-valid code is gofumpt-valid, but gofumpt enforces additional style rules. Use gofumpt exclusively.
93
+
- **govulncheck requires the Go SDK at runtime.** Unlike other tools that are standalone binaries, govulncheck uses `go/packages` to analyze module dependencies. The Go SDK is included in the dev-toolchain container for this reason.
94
+
- **Go tools use `./...` patterns.** The `./...` pattern matches all packages in the module. This is the standard Go convention for recursive operations.
95
+
- **`go.sum` presence gates security scanning.** If no `go.sum` file exists, govulncheck is skipped because there are no module dependencies to scan.
96
+
- **All tools are pre-installed in the dev-toolchain container.** Do not install them on the host.
0 commit comments