22 lines
278 B
Go
22 lines
278 B
Go
package config
|
|
|
|
import (
|
|
"os"
|
|
|
|
"github.com/BurntSushi/toml"
|
|
"github.com/rs/zerolog/log"
|
|
)
|
|
|
|
// Parse the config
|
|
func Parse(content []byte) *Config {
|
|
var cfg *Config
|
|
|
|
err := toml.Unmarshal(content, &cfg)
|
|
if err != nil {
|
|
log.Err(err).Msg("")
|
|
os.Exit(1)
|
|
}
|
|
|
|
return cfg
|
|
}
|