From d55782213c7be6936e438ef055653d2a494b127a Mon Sep 17 00:00:00 2001 From: Justin T <37750742+jtieri@users.noreply.github.com> Date: Fri, 13 Dec 2019 01:19:31 -0600 Subject: [PATCH] update config --- habbgo/utils/config.go | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 habbgo/utils/config.go 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 -}