Make SetEnvKeyReplacer similar to EnvKeyReplacer in signature so you can actually write a different implementation

This commit is contained in:
Sheridan C Rawlins 2021-05-10 20:32:50 -07:00 committed by GitHub
parent 36be6bf91f
commit d652670db2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1305,9 +1305,9 @@ func (v *Viper) AutomaticEnv() {
// SetEnvKeyReplacer sets the strings.Replacer on the viper object
// Useful for mapping an environmental variable to a key that does
// not match it.
func SetEnvKeyReplacer(r *strings.Replacer) { v.SetEnvKeyReplacer(r) }
func SetEnvKeyReplacer(r StringReplacer) { v.SetEnvKeyReplacer(r) }
func (v *Viper) SetEnvKeyReplacer(r *strings.Replacer) {
func (v *Viper) SetEnvKeyReplacer(r StringReplacer) {
v.envKeyReplacer = r
}