docs: update go sdk examples (#1393)

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
This commit is contained in:
Carlos Alexandro Becker
2026-04-14 20:50:39 -03:00
committed by GitHub
parent 66a60afe70
commit aaf86f6055
16 changed files with 122 additions and 156 deletions

View File

@@ -20,30 +20,30 @@ func main() {
// Create multiple independent sessions
session1, err := client.CreateSession(ctx, &copilot.SessionConfig{
OnPermissionRequest: copilot.PermissionHandler.ApproveAll,
Model: "gpt-5",
Model: "gpt-5.4",
})
if err != nil {
log.Fatal(err)
}
defer session1.Destroy()
defer session1.Disconnect()
session2, err := client.CreateSession(ctx, &copilot.SessionConfig{
OnPermissionRequest: copilot.PermissionHandler.ApproveAll,
Model: "gpt-5",
Model: "gpt-5.4",
})
if err != nil {
log.Fatal(err)
}
defer session2.Destroy()
defer session2.Disconnect()
session3, err := client.CreateSession(ctx, &copilot.SessionConfig{
OnPermissionRequest: copilot.PermissionHandler.ApproveAll,
Model: "claude-sonnet-4.5",
Model: "claude-sonnet-4.6",
})
if err != nil {
log.Fatal(err)
}
defer session3.Destroy()
defer session3.Disconnect()
fmt.Println("Created 3 independent sessions")
@@ -60,5 +60,5 @@ func main() {
session3.Send(ctx, copilot.MessageOptions{Prompt: "How do I initialize a module?"})
fmt.Println("Sent follow-up questions to each session")
fmt.Println("All sessions will be destroyed on exit")
fmt.Println("All sessions will be disconnected on exit")
}