From 7065aee83ad234de197bf1aa1cd301800da5532b Mon Sep 17 00:00:00 2001 From: Jeremy Daer Date: Tue, 28 Apr 2026 12:34:39 -0700 Subject: [PATCH 1/2] Fix stale Todos signatures in package doc comment The Todos service signatures changed in #279 (Completed promoted to a first-class TodoListOptions field), but four examples in the package doc comment still showed the old leading projectID argument. Update List, Create, and Complete examples to match the current signatures. --- go/pkg/basecamp/doc.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/go/pkg/basecamp/doc.go b/go/pkg/basecamp/doc.go index 35219ea2..5181a6eb 100644 --- a/go/pkg/basecamp/doc.go +++ b/go/pkg/basecamp/doc.go @@ -90,18 +90,18 @@ // // List todos in a todolist: // -// todos, err := account.Todos().List(ctx, projectID, todolistID, nil) +// todos, err := account.Todos().List(ctx, todolistID, nil) // // Create a todo: // -// todo, err := account.Todos().Create(ctx, projectID, todolistID, &basecamp.CreateTodoRequest{ +// todo, err := account.Todos().Create(ctx, todolistID, &basecamp.CreateTodoRequest{ // Content: "Ship the feature", // DueOn: "2024-12-31", // }) // // Complete a todo: // -// err := account.Todos().Complete(ctx, projectID, todoID) +// err := account.Todos().Complete(ctx, todoID) // // # Searching // @@ -176,6 +176,6 @@ // acme := client.ForAccount("12345") // initech := client.ForAccount("67890") // -// go func() { acme.Todos().List(ctx, projectID, todolistID, nil) }() +// go func() { acme.Todos().List(ctx, todolistID, nil) }() // go func() { initech.Projects().List(ctx, nil) }() package basecamp From d9b0459ab240a909a779d3d00315d76206e5ed51 Mon Sep 17 00:00:00 2001 From: Jeremy Daer Date: Tue, 28 Apr 2026 12:34:43 -0700 Subject: [PATCH 2/2] Add example for Todos List Completed filter Demonstrate the first-class Completed field on TodoListOptions introduced in #279. Mirrors the surrounding ExampleTodosService_List so godoc renders the pair together. --- go/pkg/basecamp/example_test.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/go/pkg/basecamp/example_test.go b/go/pkg/basecamp/example_test.go index e681e086..631f5fb1 100644 --- a/go/pkg/basecamp/example_test.go +++ b/go/pkg/basecamp/example_test.go @@ -149,6 +149,28 @@ func ExampleTodosService_List() { } } +func ExampleTodosService_List_completed() { + cfg := basecamp.DefaultConfig() + token := &basecamp.StaticTokenProvider{Token: os.Getenv("BASECAMP_TOKEN")} + client := basecamp.NewClient(cfg, token) + + ctx := context.Background() + + todolistID := int64(789012) + + // List only completed todos in a todolist. + todosResult, err := client.ForAccount("12345").Todos().List(ctx, todolistID, &basecamp.TodoListOptions{ + Completed: true, + }) + if err != nil { + log.Fatal(err) + } + + for _, t := range todosResult.Todos { + fmt.Printf("[x] %s\n", t.Content) + } +} + func ExampleTodosService_Create() { cfg := basecamp.DefaultConfig() token := &basecamp.StaticTokenProvider{Token: os.Getenv("BASECAMP_TOKEN")}