bubblewand/templates/config/config.go.tmpl

20 lines
359 B
Cheetah

package config
import (
"fmt"
"github.com/spf13/viper"
"{{.ModName}}/internal/logger"
)
func Init() {
viper.SetConfigName("config") // config.yaml
viper.SetConfigType("yaml")
viper.AddConfigPath(".")
err := viper.ReadInConfig()
if err != nil {
logger.Log.Info("No config file found; using defaults.")
}
viper.SetDefault("app.theme", "dark")
}