Skip to content

Commit

Permalink
Handle no input string
Browse files Browse the repository at this point in the history
  • Loading branch information
kashav committed May 17, 2017
1 parent e5553ba commit 20e5acd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ var seen = make(map[string]bool, 0)

// Read the command line arguments for the query.
func readInput() string {
if len(os.Args) == 1 {
log.Fatal("Expected query.")
}

if len(os.Args) > 2 {
return strings.Join(os.Args[1:], " ")
}
Expand Down

2 comments on commit 20e5acd

@rmgas1
Copy link

@rmgas1 rmgas1 commented on 20e5acd May 17, 2017

Choose a reason for hiding this comment

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

πŸ‘ Was about to push a proposed change for this; glad to see you're onto it :-)

@kashav
Copy link
Owner Author

@kashav kashav commented on 20e5acd May 17, 2017

Choose a reason for hiding this comment

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

@rmgas1 haha, glad I caught it! Rushed an earlier commit and missed it πŸ˜…

Please sign in to comment.