You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
308 B

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