linodego icon indicating copy to clipboard operation
linodego copied to clipboard

[Feature]: Rethink ListOptions for a more intuitive and natural interaction

Open machine424 opened this issue 1 year ago • 2 comments

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

machine424 avatar May 28 '24 08:05 machine424

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days

github-actions[bot] avatar Jun 28 '24 00:06 github-actions[bot]

@machine424 , We created a ticket in backlog for this issue. We will update you once there is some progress. Thank you for your contribution!

ykim-akamai avatar Jul 08 '24 19:07 ykim-akamai