[chore]: Bump github.com/spf13/viper from 1.20.0 to 1.20.1

Bumps [github.com/spf13/viper](https://github.com/spf13/viper) from 1.20.0 to 1.20.1.
- [Release notes](https://github.com/spf13/viper/releases)
- [Commits](https://github.com/spf13/viper/compare/v1.20.0...v1.20.1)

---
updated-dependencies:
- dependency-name: github.com/spf13/viper
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
dependabot[bot] 2025-03-31 06:10:57 +00:00 committed by GitHub
commit 109680c132
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 25 additions and 17 deletions

4
go.mod
View file

@ -2,7 +2,7 @@ module github.com/superseriousbusiness/gotosocial
go 1.23.0
toolchain go1.23.3
toolchain go1.24.1
// Replace go-swagger with our version that fixes (ours particularly) use of Go1.23
replace github.com/go-swagger/go-swagger => codeberg.org/superseriousbusiness/go-swagger v0.31.0-gts-go1.23-fix
@ -59,7 +59,7 @@ require (
github.com/prometheus/client_golang v1.21.1
github.com/rivo/uniseg v0.4.7
github.com/spf13/cobra v1.9.1
github.com/spf13/viper v1.20.0
github.com/spf13/viper v1.20.1
github.com/stretchr/testify v1.10.0
github.com/tdewolff/minify/v2 v2.22.3
github.com/technologize/otel-go-contrib v1.1.1

4
go.sum generated
View file

@ -388,8 +388,8 @@ github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo=
github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0=
github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o=
github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/viper v1.20.0 h1:zrxIyR3RQIOsarIrgL8+sAvALXul9jeEPa06Y0Ph6vY=
github.com/spf13/viper v1.20.0/go.mod h1:P9Mdzt1zoHIG8m2eZQinpiBjo6kCmZSKBClNNqjJvu4=
github.com/spf13/viper v1.20.1 h1:ZMi+z/lvLyPSCoNtFCpqjy0S4kPbirhpTMwl8BkW9X4=
github.com/spf13/viper v1.20.1/go.mod h1:P9Mdzt1zoHIG8m2eZQinpiBjo6kCmZSKBClNNqjJvu4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=

View file

@ -1535,27 +1535,29 @@ func (v *Viper) MergeInConfig() error {
func ReadConfig(in io.Reader) error { return v.ReadConfig(in) }
func (v *Viper) ReadConfig(in io.Reader) error {
if v.configType == "" {
return errors.New("cannot decode configuration: config type is not set")
config := make(map[string]any)
err := v.unmarshalReader(in, config)
if err != nil {
return err
}
v.config = make(map[string]any)
return v.unmarshalReader(in, v.config)
v.config = config
return nil
}
// MergeConfig merges a new configuration with an existing config.
func MergeConfig(in io.Reader) error { return v.MergeConfig(in) }
func (v *Viper) MergeConfig(in io.Reader) error {
if v.configType == "" {
return errors.New("cannot decode configuration: config type is not set")
}
config := make(map[string]any)
cfg := make(map[string]any)
if err := v.unmarshalReader(in, cfg); err != nil {
if err := v.unmarshalReader(in, config); err != nil {
return err
}
return v.MergeConfigMap(cfg)
return v.MergeConfigMap(config)
}
// MergeConfigMap merges the configuration from the map given with an existing config.
@ -1662,15 +1664,21 @@ func (v *Viper) writeConfig(filename string, force bool) error {
}
func (v *Viper) unmarshalReader(in io.Reader, c map[string]any) error {
format := strings.ToLower(v.getConfigType())
if format == "" {
return errors.New("cannot decode configuration: unable to determine config type")
}
buf := new(bytes.Buffer)
buf.ReadFrom(in)
format := strings.ToLower(v.getConfigType())
// TODO: remove this once SupportedExts is deprecated/removed
if !slices.Contains(SupportedExts, format) {
return UnsupportedConfigError(format)
}
// TODO: return [UnsupportedConfigError] if the registry does not contain the format
// TODO: consider deprecating this error type
decoder, err := v.decoderRegistry.Decoder(format)
if err != nil {
return ConfigParseError{err}

2
vendor/modules.txt vendored
View file

@ -791,7 +791,7 @@ github.com/spf13/cobra
# github.com/spf13/pflag v1.0.6
## explicit; go 1.12
github.com/spf13/pflag
# github.com/spf13/viper v1.20.0
# github.com/spf13/viper v1.20.1
## explicit; go 1.21.0
github.com/spf13/viper
github.com/spf13/viper/internal/encoding/dotenv