diff --git a/habbgo/utils/config.go b/habbgo/utils/config.go deleted file mode 100644 index 7277dcd..0000000 --- a/habbgo/utils/config.go +++ /dev/null @@ -1,36 +0,0 @@ -package utils - -import ( - "gopkg.in/yaml.v2" - "io/ioutil" - "log" -) - -type Config struct { - Server struct { - Host string `yaml:"host"` - Port int16 `yaml:"port"` - MaxConns int `yaml:"maxconns"` - } - Log struct { - Outgoing bool `yaml:"outgoing"` - Incoming bool `yaml:"incoming"` - } -} - -func LoadConfig() Config { - data, err := ioutil.ReadFile("./config.yml") - if err != nil { - log.Fatal("Failed to read config file 'config.yml', check that it exists & try again.", err) - } - - config := Config{} - - err = yaml.Unmarshal(data, &config) - if err != nil { - log.Fatal("Failed to unmarshal config file 'config.yml', check that its format is correct & try again.", err) - } - - log.Println("The file 'config.yml' has been successfully loaded.") - return config -}