Fix stale Todos signatures in Go SDK doc comments#290
Merged
Conversation
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.
Demonstrate the first-class Completed field on TodoListOptions introduced in #279. Mirrors the surrounding ExampleTodosService_List so godoc renders the pair together.
There was a problem hiding this comment.
Pull request overview
Updates Go SDK documentation/examples to match the current TodosService method signatures (post-#279) and adds a new example demonstrating the TodoListOptions.Completed filter.
Changes:
- Fix stale
Todos().List,Todos().Create, andTodos().Completedoc-comment examples by removing the obsolete leadingprojectIDargument. - Update the concurrency snippet in the package docs to use the corrected
Todos().Listsignature. - Add
ExampleTodosService_List_completedto demonstrate filtering to completed todos viaTodoListOptions.Completed.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| go/pkg/basecamp/example_test.go | Adds a new runnable documentation example for listing only completed todos. |
| go/pkg/basecamp/doc.go | Updates package-level doc snippets to reflect current Todos method signatures. |
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Todosexamples in the package doc comment (go/pkg/basecamp/doc.go) that still showed the pre-fix(todos): use completed=true for completed filters #279 leadingprojectIDargument. BringsList,Create, andCompleteexamples back in sync with the canonical signatures ingo/pkg/basecamp/todos.go.ExampleTodosService_List_completedto demonstrate the first-classCompletedfield onTodoListOptionsintroduced in fix(todos): use completed=true for completed filters #279.Test plan
go build ./...go test ./pkg/basecamp/...(compilesexample_test.go, validating the new example's signature)go vet ./...gofmt -l pkg/basecamp/doc.go pkg/basecamp/example_test.go(empty output)go doc github.com/basecamp/basecamp-sdk/go/pkg/basecamp— confirmed the four updated examples render with the corrected signaturesSummary by cubic
Fixes stale Todos examples in the Go SDK docs by removing the old
projectIDargument to match currentList,Create, andCompletesignatures. Adds an example showing theTodoListOptions.Completedfilter from #279 to illustrate listing completed todos.Bug Fixes
go/pkg/basecamp/doc.goto the current signatures (no leadingprojectID).New Features
ExampleTodosService_List_completedingo/pkg/basecamp/example_test.godemonstratingTodoListOptions.Completed.Written for commit d9b0459. Summary will update on new commits. Review in cubic