Skip to content

Commit eb5cff8

Browse files
authored
Correct phrasing in SDK documentation (#1254)
* Correct phrasing in SDK documentation * Fix typos in Go instructions Fix typos in Go instructions
1 parent ca87cfc commit eb5cff8

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

instructions/copilot-sdk-go.instructions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ session, err := client.ResumeSessionWithOptions("session-id", &copilot.ResumeSes
123123

124124
### Event Subscription Pattern
125125

126-
ALWAYS use channels or done signals for waiting on session events:
126+
ALWAYS use channels or done signals to wait for session events:
127127

128128
```go
129129
done := make(chan struct{})
@@ -381,7 +381,7 @@ session2.Send(copilot.MessageOptions{Prompt: "Hello from session 2"})
381381

382382
## Bring Your Own Key (BYOK)
383383

384-
Use custom API providers via `ProviderConfig`:
384+
Use custom API providers by configuring `ProviderConfig`:
385385

386386
```go
387387
session, err := client.CreateSession(&copilot.SessionConfig{
@@ -437,7 +437,7 @@ session.On(func(evt copilot.SessionEvent) {
437437

438438
## Connectivity Testing
439439

440-
Use Ping to verify server connectivity:
440+
Use `Ping` to verify server connectivity:
441441

442442
```go
443443
resp, err := client.Ping("test message")

instructions/go.instructions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ Follow idiomatic Go practices and community standards when writing Go code. Thes
9191
- Use line comments (`//`) for most comments
9292
- Use block comments (`/* */`) sparingly, mainly for package documentation
9393
- Document why, not what, unless the what is complex
94-
- Avoid emoji in comments and code
94+
- Avoid using emoji in comments and code
9595

9696
### Error Handling
9797

@@ -224,7 +224,7 @@ Follow idiomatic Go practices and community standards when writing Go code. Thes
224224

225225
### HTTP Clients
226226

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
228228
- 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
229229
- 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)`
230230
- 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
368368
- Not understanding nil interfaces vs nil pointers
369369
- Forgetting to close resources (files, connections)
370370
- 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{}`
372372
- Not considering the zero value of types
373373
- **Creating duplicate `package` declarations** - this is a compile error; always check existing files before adding package declarations

0 commit comments

Comments
 (0)