使用viper的配置文件在GO中提供了空值

i am new in Go and using viper for configuration management

configuration file looks like (config.yaml)

SD_ORIGIN : web url
API_TRACKING_ID : 77xxx1
API_TOKEN : sdsaxxxdfds123

And using the go code to read the value but getting null value while i read code snippet as :-

    viper.SetConfigName("config")
    viper.AddConfigPath(".")
    err := viper.ReadInConfig()
    if err != nil {
        fmt.Println("Config not found...")
    }
}

var apiTrackingID = viper.GetString("API_TRACKING_ID")

Please help to find the issue in my config file or implementation in Go.

better to check this https://github.com/spf13/viper the code snippet looks good ..may be there can be issue with $GOPATH and $GOHOME

and your config.yaml file is not proper double quotes are missing.

API_TOKEN : "sdsaxxxdfds123"

It has to be like this, hope this resolves your problem.