-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minimize top-level API surface area for both usability clarity and maintenance reduction #1531
Comments
(Continuing discussion from #833)
@marwan-at-work I should have explained myself better, sorry! The interpretation of the go docs I'm leaning on here comes from the overview
meaning that we're not supposed to be wrapping Aside from that particular interpretation issue, I'd like to make sure we are moving towards the design detailed in the series of issues tracked in #1531 which would result in an action func signature of: type ActionFunc func(ctx context.Context, cmd *Command) error |
@marwan-at-work can you move your comment over here? 🙇🏼 |
@meatballhat ah, yes storing context vs passing it. In most cases, you want a function to accept a context. But FWIW the Go team themselves break that rule in multiple places:
With all of that said, I'm definitely happy with any solution as long as we have a full context accessible from the outside :) From issue 1531, it looks like y'all are thinking of removing the |
@marwan-at-work Thank you for caring about this! 💖 Sorry for my (two weeks??) delay! The places you reference in the standard library are great examples of how the core Go team adapted existing APIs after the I'm leaning more and more towards wanting to remove the type ActionFunc func(context.Context, *Command) error |
Duplicate of #1774 |
App
code intoCommand
#1586.Commands
field throughout (replace.Subcommands
) #1600Context
code intoCommand
#1587strconv
#1759(context.Context, *Command)
to action funcs instead of(*Context)
#1780The text was updated successfully, but these errors were encountered: