mirror of
https://github.com/spf13/viper
synced 2024-09-28 18:36:19 +00:00
Merge 8f88ea76a6
into ea35b92596
This commit is contained in:
commit
af94b95ab9
4
viper.go
4
viper.go
|
@ -1793,7 +1793,9 @@ func (v *Viper) writeConfig(filename string, force bool) error {
|
||||||
|
|
||||||
func (v *Viper) unmarshalReader(in io.Reader, c map[string]any) error {
|
func (v *Viper) unmarshalReader(in io.Reader, c map[string]any) error {
|
||||||
buf := new(bytes.Buffer)
|
buf := new(bytes.Buffer)
|
||||||
buf.ReadFrom(in)
|
if _, err := buf.ReadFrom(in); err != nil {
|
||||||
|
return ConfigParseError{err}
|
||||||
|
}
|
||||||
|
|
||||||
switch format := strings.ToLower(v.getConfigType()); format {
|
switch format := strings.ToLower(v.getConfigType()); format {
|
||||||
case "yaml", "yml", "json", "toml", "hcl", "tfvars", "ini", "properties", "props", "prop", "dotenv", "env":
|
case "yaml", "yml", "json", "toml", "hcl", "tfvars", "ini", "properties", "props", "prop", "dotenv", "env":
|
||||||
|
|
Loading…
Reference in a new issue