twister/internal/config/parse.go
2024-10-09 13:27:29 +01:00

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
}