(v *Viper)
| 91 | }`) |
| 92 | |
| 93 | func initConfigs(v *Viper) { |
| 94 | var r io.Reader |
| 95 | v.SetConfigType("yaml") |
| 96 | r = bytes.NewReader(yamlExample) |
| 97 | v.unmarshalReader(r, v.config) |
| 98 | |
| 99 | v.SetConfigType("json") |
| 100 | r = bytes.NewReader(jsonExample) |
| 101 | v.unmarshalReader(r, v.config) |
| 102 | |
| 103 | v.SetConfigType("toml") |
| 104 | r = bytes.NewReader(tomlExample) |
| 105 | v.unmarshalReader(r, v.config) |
| 106 | |
| 107 | v.SetConfigType("env") |
| 108 | r = bytes.NewReader(dotenvExample) |
| 109 | v.unmarshalReader(r, v.config) |
| 110 | |
| 111 | v.SetConfigType("json") |
| 112 | remote := bytes.NewReader(remoteExample) |
| 113 | v.unmarshalReader(remote, v.kvstore) |
| 114 | } |
| 115 | |
| 116 | func initConfig(typ, config string, v *Viper) { |
| 117 | v.SetConfigType(typ) |
no test coverage detected