Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Integralist
Copy link
Collaborator

@Integralist Integralist commented Sep 29, 2023

There's a common pattern used across the CLI where we...

  • Start a spinner.
  • Start doing some processing.
  • Stop the spinner...
    • Because of an error.
    • Because we're finished.

It's very tedious and verbose/noisy code and makes reading the code quite hard at times.

So I've made an abstraction to try and reduce the noise.

The spinner abstraction can be seen in pkg/text/spinner.go.

@Integralist Integralist added the enhancement New feature or request label Sep 29, 2023
Copy link
Collaborator

@awilliams-fastly awilliams-fastly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! This really removes a lot of boilerplate.

I reviewed the changes where the SpinnerWrapper is used, but mainly focused on the implementation. Left a few minor comments, but looking good in general.

@Integralist Integralist force-pushed the integralist/abstract-spinner branch from 91f8a5b to 7ba5b64 Compare October 2, 2023 09:26
@Integralist Integralist merged commit cee7784 into main Oct 2, 2023
@Integralist Integralist deleted the integralist/abstract-spinner branch October 2, 2023 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants