Skip to content

Commit 8cf2fd5

Browse files
Pin go version for feedback
1 parent f2fb579 commit 8cf2fd5

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

.github/copilot-instructions.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,41 @@ pull request review. Path-specific guidance lives under `.github/instructions/`.
77
ALWAYS acknowledge in the review summary that these provider review
88
instructions are being used.
99

10+
## Language and Tooling Context
11+
12+
Before judging Go code, anchor on the versions this repo actually uses.
13+
Do not flag patterns as bugs or anti-patterns based on assumptions about
14+
older toolchains.
15+
16+
- **Go version: 1.24** (see `go 1.24.4` in `go.mod`). Treat anything
17+
available in Go ≤ 1.24 as in-scope and idiomatic.
18+
- **Loop variable scoping (Go 1.22+).** Each iteration of `for` loops has
19+
its own copy of the loop variable. Do **not** suggest the pre-1.22
20+
`x := x` shadowing pattern inside loops, and do **not** flag goroutines
21+
or closures that capture the loop variable directly as a bug.
22+
- **`range over int` (Go 1.22+).** `for i := range 10 { ... }` is valid.
23+
Do not suggest rewriting to `for i := 0; i < 10; i++`.
24+
- **`range over func` (Go 1.23+).** Custom iterators using
25+
`iter.Seq`/`iter.Seq2` are valid.
26+
- **`min` / `max` / `clear` built-ins (Go 1.21+)** are valid.
27+
- **Generics (Go 1.18+)** are valid.
28+
- **`slices` and `maps` standard library packages** are available.
29+
30+
When a Go feature looks unfamiliar, assume the toolchain in `go.mod` is
31+
authoritative. If you cannot verify that something would fail to compile
32+
under the declared Go version, do not claim it will. Phrase any
33+
genuine concern as a question, not a finding, and only do so when the
34+
issue would be HIGH or MEDIUM per the policy above.
35+
36+
### Other tooling versions to anchor on
37+
38+
- **Terraform Plugin SDK v2** — schema definitions use
39+
`github.com/hashicorp/terraform-plugin-sdk/v2`. Do not suggest
40+
Plugin Framework patterns in SDKv2 files or vice versa.
41+
- **`google/go-github`** — see `go.mod` for the exact major version
42+
pinned. Do not suggest API method names or types from a different
43+
major version of the client.
44+
1045
## Severity and Nit Policy (read first)
1146

1247
This repository is **community-maintained**. Contributor friction is the

0 commit comments

Comments
 (0)