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.
 
 

25 lines
450 B

package main
import (
"encoding/json"
"fmt"
"io/ioutil"
)
type Config struct {
ServerIP string `json:"serverIP"`
ServerPort string `json:"serverPort"`
ImgWidth int `json:"imgWidth"`
ImgHeigh int `json:"imgHeigh"`
}
var config Config
func readConfig(path string) {
file, err := ioutil.ReadFile(path)
if err != nil {
fmt.Println("error: ", err)
}
content := string(file)
json.Unmarshal([]byte(content), &config)
}