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

commands: fix opt.Description panic when desc was empty #3521

Merged
merged 1 commit into from
Dec 21, 2016

Conversation

Kubuxu
Copy link
Member

@Kubuxu Kubuxu commented Dec 19, 2016

Resolves #3520

License: MIT
Signed-off-by: Jakub Sztandera [email protected]

@Kubuxu Kubuxu requested review from a user and whyrusleeping December 19, 2016 14:00
@Kubuxu Kubuxu added the status/in-progress In progress label Dec 19, 2016
@ghost
Copy link

ghost commented Dec 19, 2016

:):)

LGTM

@Kubuxu Kubuxu self-assigned this Dec 19, 2016
Copy link
Member

@whyrusleeping whyrusleeping left a comment

Choose a reason for hiding this comment

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

Change LGTM as is, but i suggested a tweak that improves the code style in general

@@ -43,6 +43,9 @@ func (o *option) Type() reflect.Kind {
}

func (o *option) Description() string {
if len(o.description) == 0 {
return ""
}
if o.description[len(o.description)-1] != '.' {
Copy link
Member

Choose a reason for hiding this comment

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

We can change this to:

if !strings.HasSuffix(o.description, ".") {
    o.description += "."
}

@Kubuxu Kubuxu force-pushed the feat/commands/no-option-desc branch from 00fac9a to 591e826 Compare December 20, 2016 21:56
@Kubuxu
Copy link
Member Author

Kubuxu commented Dec 20, 2016

@whyrusleeping should be good for merge

Copy link
Member

@whyrusleeping whyrusleeping left a comment

Choose a reason for hiding this comment

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

LGTM, thanks

@whyrusleeping whyrusleeping merged commit e286462 into master Dec 21, 2016
@whyrusleeping whyrusleeping deleted the feat/commands/no-option-desc branch December 21, 2016 19:19
@whyrusleeping whyrusleeping removed the status/in-progress In progress label Dec 21, 2016
@ghost ghost mentioned this pull request Dec 23, 2016
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.

2 participants