Check arguments.

This commit is contained in:
Gea-Suan Lin
2024-02-18 22:00:43 +08:00
parent 64a2507631
commit 2d1c6f161a

View File

@@ -11,6 +11,11 @@ import (
)
func main() {
if len(os.Args) < 2 {
fmt.Printf("You need to specify a keyword to search.\n")
os.Exit(1)
}
articles := artifact.Read("data/articles.json")
tokens := make(map[string][]string)