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
274 B

  1. package main
  2. import (
  3. "encoding/json"
  4. "io/ioutil"
  5. )
  6. type Config struct {
  7. Port string `json:"port"`
  8. }
  9. var config Config
  10. func readConfig(path string) {
  11. file, err := ioutil.ReadFile(path)
  12. check(err)
  13. content := string(file)
  14. json.Unmarshal([]byte(content), &config)
  15. }