You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

23 lines
380 B

package main
import "github.com/spf13/viper"
type Config struct {
GethURL string
PrivK string
}
var config Config
func ReadConfig(path, filename string) {
viper.SetConfigName(filename)
viper.AddConfigPath(path)
viper.SetConfigType("yaml")
if err := viper.ReadInConfig(); err != nil {
panic(err)
}
err := viper.Unmarshal(&config)
if err != nil {
panic(err)
}
}