MVP
This commit is contained in:
commit
d5762330da
23 changed files with 718 additions and 0 deletions
19
templates/config/config.go.tmpl
Normal file
19
templates/config/config.go.tmpl
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
package config
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
func Init() {
|
||||
viper.SetConfigName("config") // config.yaml
|
||||
viper.SetConfigType("yaml")
|
||||
viper.AddConfigPath(".")
|
||||
|
||||
err := viper.ReadInConfig()
|
||||
if err != nil {
|
||||
fmt.Println("No config file found; using defaults.")
|
||||
}
|
||||
|
||||
viper.SetDefault("app.theme", "dark")
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue