arnaucube
arnaucube/darkID-prototypePublic Self-hosted repository
darkID-prototype/clientApp/readConfig.go
clientApp/readConfig.goRaw
 1package main
 2
 3import (
 4	"encoding/json"
 5	"io/ioutil"
 6)
 7
 8//Config reads the config
 9type Config struct {
10	Port   string `json:"port"`
11	Server string `json:"server"`
12}
13
14var config Config
15
16func readConfig(path string) {
17	file, err := ioutil.ReadFile(path)
18	check(err)
19	content := string(file)
20	json.Unmarshal([]byte(content), &config)
21}