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.

27 lines
570 B

  1. package main
  2. import (
  3. "encoding/json"
  4. "fmt"
  5. "io/ioutil"
  6. )
  7. //TimmyConfig is the configuration from the file timmyConfig.json, on the folder /webInput
  8. type TimmyConfig struct {
  9. Title string `json:"title"`
  10. Author string `json:"author"`
  11. Github string `json:"github"`
  12. Website string `json:"website"`
  13. Files []string `json:"files"`
  14. }
  15. var timmyConfig TimmyConfig
  16. func readTimmyConfig(path string) {
  17. file, e := ioutil.ReadFile(path)
  18. if e != nil {
  19. fmt.Println("error:", e)
  20. }
  21. content := string(file)
  22. json.Unmarshal([]byte(content), &timmyConfig)
  23. }