[Feature]: Rethink ListOptions for a more intuitive and natural interaction
- Dominant language
- Go
- Stars
- 167
- Forks
- 114
- Avg merge
- 5d 20h
- Merged PRs (30d)
- 5
Description
### Description
Despite what one may think when encountering `ListOptions`, it's not that immutable input that would only be used to pass options. It's also used, for example, to track the pagination state: https://github.com/linode/linodego/blob/3bcb4a6ec66514a687a659ecf4cbb83e18d92069/pagination.go#L94-L99
The fact that it's passed by reference should warn users about its mutability, but I don't think it's sufficient. Perhaps renaming the struct or splitting it may help better.
Motivation: In Prometheus, before https://github.com/prometheus/prometheus/pull/14141, we were using the same `ListOptions` instance over and over (which led to inaccurate results of course), I’m concerned that we might fall into the same pattern of “misuse” in the future.
### Example Code
_No response_
Contributor guide
Research direction
Start by reading pagination.go around lines 94-99 to understand how ListOptions tracks pagination state, then review how the same instance is reused across the client. Done means reaching an agreed design for renaming or splitting the options and making the interaction less prone to accidental reuse.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100