embeded templates
This commit is contained in:
parent
bf78461bbb
commit
9e4d1a6a28
18 changed files with 63 additions and 58 deletions
19
embed/templates/config/config.go.tmpl
Normal file
19
embed/templates/config/config.go.tmpl
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
package config
|
||||
|
||||
import (
|
||||
"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")
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue