Skip to content
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

feat: allow non-structs to be used as commands #428

Conversation

costela
Copy link
Contributor

@costela costela commented May 21, 2024

This small MR allows using the func-to-interface trick to implement a command (see commandFunc in kong_test.go).

This is useful e.g. for commands that have no flags or arguments of their own, but instead receive all required information via bound parameters.

❓ we could (but don't need to) also provide a CommandFunc type, analogous to http.HandlerFunc.

This small MR allows using the func-to-interface trick to implement a command (see commandFunc in kong_test.go).

This is useful e.g. for commands that have no flags or arguments of their own, but instead receive all required information via bound  parameters.
build.go Show resolved Hide resolved
@alecthomas alecthomas merged commit e864bb0 into alecthomas:master Jul 5, 2024
@alecthomas
Copy link
Owner

Thanks!

@costela costela deleted the leo.antunes/allow-non-structs-to-be-used-as-commands branch July 5, 2024 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants