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
Copy file name to clipboardExpand all lines: instructions/go.instructions.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -91,7 +91,7 @@ Follow idiomatic Go practices and community standards when writing Go code. Thes
91
91
- Use line comments (`//`) for most comments
92
92
- Use block comments (`/* */`) sparingly, mainly for package documentation
93
93
- Document why, not what, unless the what is complex
94
-
- Avoid emoji in comments and code
94
+
- Avoid using emoji in comments and code
95
95
96
96
### Error Handling
97
97
@@ -224,7 +224,7 @@ Follow idiomatic Go practices and community standards when writing Go code. Thes
224
224
225
225
### HTTP Clients
226
226
227
-
- Keep the client struct focused on configuration and dependencies only (e.g., base URL, `*http.Client`, auth, default headers). It must not store per-request state
227
+
- Keep the client struct focused on configuration and dependencies only (e.g., base URL, `*http.Client`, auth, default headers). It must not store any per-request state
228
228
- Do not store or cache `*http.Request` inside the client struct, and do not persist request-specific state across calls; instead, construct a fresh request per method invocation
229
229
- Methods should accept `context.Context` and input parameters, assemble the `*http.Request` locally (or via a short-lived builder/helper created per call), then call `c.httpClient.Do(req)`
230
230
- If request-building logic is reused, factor it into unexported helper functions or a per-call builder type; never keep `http.Request` (URL params, body, headers) as fields on the long-lived client
@@ -368,6 +368,6 @@ Follow idiomatic Go practices and community standards when writing Go code. Thes
368
368
- Not understanding nil interfaces vs nil pointers
369
369
- Forgetting to close resources (files, connections)
370
370
- Using global variables unnecessarily
371
-
-Over-using unconstrained types (e.g., `any`); prefer specific types or generic type parameters with constraints. If an unconstrained type is required, use `any` rather than `interface{}`
371
+
-Overusing unconstrained types (e.g., `any`); prefer specific types or generic type parameters with constraints. If an unconstrained type is required, use `any` rather than `interface{}`
372
372
- Not considering the zero value of types
373
373
-**Creating duplicate `package` declarations** - this is a compile error; always check existing files before adding package declarations
0 commit comments