3
0
Fork 0
This repository has been archived on 2024-11-14. You can view files and clone it, but cannot push or open issues or pull requests.
ThemeParkPlus-Socket/objects/config.go

22 lines
384 B
Go
Raw Normal View History

2022-08-12 19:08:47 +00:00
package objects
import (
"encoding/json"
"io/ioutil"
)
type Configuration struct {
Address string `json:"address"`
Debug bool `json:"debug"`
}
func LoadConfiguration(file string) (Configuration, error) {
bytes, err := ioutil.ReadFile(file)
if err != nil {
return Configuration{}, err
}
var config Configuration
err = json.Unmarshal(bytes, &config)
return config, err
}