echo-botnet/readKeywordsConfig.go
readKeywordsConfig.goRaw
1package main
2
3import (
4 "encoding/json"
5 "fmt"
6 "io/ioutil"
7)
8
9func readKeywordsConfig() []string {
10 var keywords []string
11 file, e := ioutil.ReadFile("keywordsConfig.json")
12 if e != nil {
13 fmt.Println("error:", e)
14 }
15 content := string(file)
16 json.Unmarshal([]byte(content), &keywords)
17
18 return keywords
19}