Skip to content

Commit 20e5acd

Browse files
committed
Handle no input string
1 parent e5553ba commit 20e5acd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

main.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ var seen = make(map[string]bool, 0)
2626

2727
// Read the command line arguments for the query.
2828
func readInput() string {
29+
if len(os.Args) == 1 {
30+
log.Fatal("Expected query.")
31+
}
32+
2933
if len(os.Args) > 2 {
3034
return strings.Join(os.Args[1:], " ")
3135
}

0 commit comments

Comments
 (0)