15:10:14 jcase@jcase-mn1 vipertest ./vipertest -l debug subcmd --value1 h --value2 b
ALL SETTINGS JSON
{
"log_level": "debug",
"subcmd": {
"value1": "h",
"value2": "b"
}
}
SUB SETTINGS JSON
{
"value1": "a"
}
cfg := &ServerConfig{
RedisURL: viper.GetString("redis_port_6379_tcp") | viper.GetString("database_url"),
}
Hi! I've noticed when loading an HCL file that it is read with slices under each key and not as a hash. The file is read correctly when using hcl.Decode
, so it seems to be something with viper.
I seem to hit the same thing whether using viper.ReadInConfig
or viper.ReadConfig
and wondering something had come across this or if I'm doing something wrong. (not sure best way to share example code and output)
db_host: localhost
db_user: appuser
test:
db_host: test-host
Hello Devs, I use Viper to handle the configuration for a REST service. DELETE/POST/PUT requests have the potential to modify the config after which I use viper.WriteConfig() to persist the changes.
My question is whether other or not there's a built-in or easy way to do a rolling history of the last X number of configs? I've looked at the docs, and I don't believe so, but wanted to reach out to double check.
MY_VARIABLE
, does Viper do any kind of default rewriting (aside from lowercase) to access that value? So Get("my_variable")
...? If I want it to be camelCase I'll need to SetEnvKeyReplacer
, right? (Looking at viper_test.go
it seems this is how it works).