glp/configuration/exported.go

30 lines
432 B
Go
Raw Normal View History

2020-02-06 15:09:25 +05:00
package configuration
import (
// stdlib
"flag"
"log"
"os"
)
var (
configurationPath string
Cfg *config
)
// Initialize initializes package.
func Initialize(cfgpath string) {
log.Println("Initializing configuration")
configurationPath = cfgpath
Cfg = &config{}
err := Cfg.initialize()
if err != nil {
log.Println("Error appeared when loading configuration:", err.Error())
flag.PrintDefaults()
os.Exit(1)
}
}