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

Usage(err interface{}) only uses values of type error #24

Closed
aefalcon opened this issue Sep 7, 2018 · 1 comment
Closed

Usage(err interface{}) only uses values of type error #24

aefalcon opened this issue Sep 7, 2018 · 1 comment

Comments

@aefalcon
Copy link

aefalcon commented Sep 7, 2018

Regarding func (*Command) Usage(err interface{}) string, only values of err with types subCommandError and error are used by the function. Because subCommandError is an implementation of error, the argument should really be of type error.

It would be nice if it also accounted for string and fmt.Stringer, but I think documentation should at least note what the supported types are.

@akamensky
Copy link
Owner

I agree it should accept strings and related types.

I may be able to look at this later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants