mirror of https://github.com/spf13/viper.git
fix: lint
This commit is contained in:
parent
e354c1be00
commit
09ab207375
2
viper.go
2
viper.go
|
@ -1635,7 +1635,6 @@ func (v *Viper) unmarshalReader(in io.Reader, c map[string]interface{}) error {
|
||||||
buf.ReadFrom(in)
|
buf.ReadFrom(in)
|
||||||
|
|
||||||
switch format := strings.ToLower(v.getConfigType()); format {
|
switch format := strings.ToLower(v.getConfigType()); format {
|
||||||
|
|
||||||
case "yaml", "yml", "json", "cue", "toml", "hcl", "tfvars":
|
case "yaml", "yml", "json", "cue", "toml", "hcl", "tfvars":
|
||||||
err := decoderRegistry.Decode(format, buf.Bytes(), &c)
|
err := decoderRegistry.Decode(format, buf.Bytes(), &c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -1693,7 +1692,6 @@ func (v *Viper) unmarshalReader(in io.Reader, c map[string]interface{}) error {
|
||||||
func (v *Viper) marshalWriter(f afero.File, configType string) error {
|
func (v *Viper) marshalWriter(f afero.File, configType string) error {
|
||||||
c := v.AllSettings()
|
c := v.AllSettings()
|
||||||
switch configType {
|
switch configType {
|
||||||
|
|
||||||
case "yaml", "yml", "json", "cue", "toml", "hcl", "tfvars":
|
case "yaml", "yml", "json", "cue", "toml", "hcl", "tfvars":
|
||||||
b, err := encoderRegistry.Encode(configType, c)
|
b, err := encoderRegistry.Encode(configType, c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue