I use viper to load runtime environment specific property files (located under ./configs/*.conf). I am looking to see how I can embed these files in the binary.
Following snippet that loads the files
viper.AddConfigPath("./configs")
viper.SetConfigName("app_dev.conf")
viper.ReadInConfig()
I have tried using the following embed directive
//go:embed configs/*.conf
var resources embed.FS
However getting an error that it cannot load the property files. It works, as expected, if I add the config folder in the same location as the binary.
I realized that I can use io.reader to load Viper config