11a792d96c
Signed-off-by: Odyssey <odyssey346@disroot.org>
23 lines
381 B
Go
23 lines
381 B
Go
package config
|
|
|
|
import (
|
|
"log"
|
|
|
|
"github.com/spf13/viper"
|
|
)
|
|
|
|
var (
|
|
result string
|
|
)
|
|
|
|
func AuthToken() string {
|
|
viper.SetConfigName("config")
|
|
viper.AddConfigPath("./data")
|
|
err := viper.ReadInConfig()
|
|
if err != nil {
|
|
log.Println("Error reading config. Error getting: segfautils.auth_token", err.Error())
|
|
}
|
|
result := viper.GetString("segfautils.auth_token")
|
|
return result
|
|
}
|