Commit 6adf24d5 authored by Sandeep S. Shewalkar's avatar Sandeep S. Shewalkar
Browse files

Merge branch 'stagingbranch' into 'master'

uncommented the code

See merge request !15
parents ad42299b 6babf86b
Branches
Tags
1 merge request!15uncommented the code
Showing with 15 additions and 12 deletions
package confighelper package confighelper
import (
"fmt"
"github.com/spf13/viper"
)
//InitViper function to initialize viper //InitViper function to initialize viper
func InitViper() { func InitViper() {
// viper.SetConfigName("config") // name of config file (without extension) viper.SetConfigName("config") // name of config file (without extension)
// viper.AddConfigPath(".") // optionally look for config in the working directory viper.AddConfigPath(".") // optionally look for config in the working directory
// err := viper.ReadInConfig() err := viper.ReadInConfig()
// // Find and read the config file // Find and read the config file
// if err != nil { // Handle errors reading the config file if err != nil { // Handle errors reading the config file
// panic(fmt.Errorf("Fatal error config file %s ", err)) panic(fmt.Errorf("Fatal error config file %s ", err))
// } }
} }
//GetConfig method to get configs from config file //GetConfig method to get configs from config file
func GetConfig(keyName string) string { func GetConfig(keyName string) string {
keyValue := viper.GetString(keyName)
// keyValue := viper.GetString(keyName) return keyValue
// return keyValue
return ""
} }
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment