You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sorry, i have a problem with cobra when i create a test function. my config file in .yaml file. i created subcommand with cobra add list
and in initConfig function on root.go, i pointing to my config file with this code viper.AddConfigPath(".") viper.SetConfigName(".todo") viper.SetConfigType("yaml")
when i run go run main.go list, it run perfectly.
but when i run go test, config file not load.
this is my very simple test to reproduce this case https://github.com/teguh11/todolistgotest
The text was updated successfully, but these errors were encountered:
sorry, i have a problem with cobra when i create a test function. my config file in .yaml file. i created subcommand with
cobra add list
and in initConfig function on root.go, i pointing to my config file with this code
viper.AddConfigPath(".")
viper.SetConfigName(".todo")
viper.SetConfigType("yaml")
when i run
go run main.go list
, it run perfectly.but when i run
go test
, config file not load.this is my very simple test to reproduce this case
https://github.com/teguh11/todolistgotest
The text was updated successfully, but these errors were encountered: