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

Validate a name of theme #16

Merged
merged 2 commits into from
Sep 18, 2019
Merged

Validate a name of theme #16

merged 2 commits into from
Sep 18, 2019

Conversation

tobynet
Copy link
Contributor

@tobynet tobynet commented Sep 18, 2019

Motivation

If the theme does not exist, the longcat causes panic.
This is not easy-to-understand for humankind.

2019-09-17_bjj6l-longcat-error

  • Add validation of theme name
  • Add -themes option to list themes

ref. Supporting theme #12

Before

$ go run main.go -n 2 -H -t wlongcat
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x████████]

goroutine 1 [running]:
main.main()
        ████████████████████████████████████████████longcat/main.go:151 +0x4d5
exit status 2

After

$ go run main.go -n 2 -H -t wlongcat
████████ ████ theme does not exist: wlongcat
exit status 1

$ go run main.go -themes
longcat
tacgnol

@mattn mattn merged commit 8754c4f into mattn:master Sep 18, 2019
@mattn
Copy link
Owner

mattn commented Sep 18, 2019

Thanks

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