heshoots/discordbot

View on GitHub
pkg/models/db.go

Summary

Maintainability
A
0 mins
Test Coverage
package models

import (
    "fmt"
    "github.com/spf13/viper"
)

func RoleConfig() {
    viper.SetConfigName("config")
    viper.AddConfigPath(".")
    viper.AddConfigPath("./config")
    viper.AddConfigPath("/etc/discordbot")
    err := viper.ReadInConfig()
    if err != nil {
        panic(fmt.Errorf("Fatal error config file: %s \n", err))
    }
}