godo icon indicating copy to clipboard operation
godo copied to clipboard

Update README with modern pagination helper

Open nicois opened this issue 5 months ago • 2 comments

Instead of requiring consumers of godo to hand-craft separate wrapper functions for each paginated List* function, demonstrate how to use golang generics to write a single helper.

Additionally, use the slices pattern to avoid wasteful memory usage buffering responses, and demonstrate how this can also work for List* functions which require an additional argument.

Fixes #861

nicois avatar Jul 18 '25 01:07 nicois

While something similar could easily be done to handle token-based pagination, there is only a single function which uses this approach so the existing example is sufficient.

nicois avatar Jul 18 '25 01:07 nicois

@SSharma-10 you merged the main branch into this PR last month. I'm not sure that's what you intended to do. I rebased this commit off the current main commit; can you please re-review?

nicois avatar Sep 03 '25 20:09 nicois