Repository navigation
Conversation
|
another idea would be to have a type Spinner[T any] struct {
action func () T
// ..and maybe a type Spinner2[T any, Q any] struct {
action func() (T, Q)
}the later being most commonly used as |
|
@maaslalani I reworked some stuff:
|
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
|
I think this might also fix #196 |
|
one bad thing about this, is that it might be a breaking change 🤔 |
|
Can't you support both signature with generics? 🤔 |
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
|
also added the feature from #172 here |
|
I think I'm missing something obvious here - what's wrong with how we're currently handling actions and how does this change improve that? |
if i recall correctly, if you passed both a context and a function it didn't work properly, that's fixed here |
Co-authored-by: Christian Rocha <christian@rocha.is>
Co-authored-by: ccoVeille <3875889+ccoVeille@users.noreply.github.com>
Co-authored-by: ccoVeille <3875889+ccoVeille@users.noreply.github.com>
Co-authored-by: ccoVeille <3875889+ccoVeille@users.noreply.github.com>
This PR started as a small one but grew up as I was finding more problems.
ActionWithError(func(context.Context) error), which allows to use the spinner context and return an error, improving error cases usageOutputto set the output, mainly for testing, but might be useful in more placestea.Cmd) instead of outside