From fd09d3999e0d75a400643cef99b919c34dbf8dbc Mon Sep 17 00:00:00 2001 From: Chris Bandy Date: Wed, 27 Aug 2025 21:42:38 -0500 Subject: [PATCH] Reduce dependency graph by bumping dependencies Updating these two direct dependencies reduces the number of indirect dependencies to almost zero. The "gopkg.in/yaml.v2" module has moved to "go.yaml.in/yaml/v2" and is now maintained by the YAML organization on GitHub. See: https://www.github.com/pelletier/go-toml/issues/872 See: https://www.github.com/yaml/go-yaml/discussions/11 --- ffjson/ffjson.go | 2 +- ffyaml/ffyaml.go | 4 ++-- go.mod | 4 ++-- go.sum | 23 ++++------------------- 4 files changed, 9 insertions(+), 24 deletions(-) diff --git a/ffjson/ffjson.go b/ffjson/ffjson.go index 81f0b5d..045b478 100644 --- a/ffjson/ffjson.go +++ b/ffjson/ffjson.go @@ -31,7 +31,7 @@ func (p Parser) Parse(r io.Reader, set func(name, value string) error) error { d := json.NewDecoder(r) d.UseNumber() // required for stringifying values - var m map[string]interface{} + var m map[string]any if err := d.Decode(&m); err != nil { return err } diff --git a/ffyaml/ffyaml.go b/ffyaml/ffyaml.go index 05e4975..d58b731 100644 --- a/ffyaml/ffyaml.go +++ b/ffyaml/ffyaml.go @@ -6,7 +6,7 @@ import ( "io" "github.com/peterbourgon/ff/v4/internal/ffdata" - "gopkg.in/yaml.v2" + "go.yaml.in/yaml/v2" ) // Parse is a helper function that uses a default parser. @@ -29,7 +29,7 @@ func (p Parser) Parse(r io.Reader, set func(name, value string) error) error { p.Delimiter = "." } - var m map[string]interface{} + var m map[string]any if err := yaml.NewDecoder(r).Decode(&m); err != nil && !errors.Is(err, io.EOF) { return err } diff --git a/go.mod b/go.mod index d3ca464..ac7faac 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,6 @@ module github.com/peterbourgon/ff/v4 go 1.21.0 require ( - github.com/pelletier/go-toml/v2 v2.0.9 - gopkg.in/yaml.v2 v2.4.0 + github.com/pelletier/go-toml/v2 v2.2.4 + go.yaml.in/yaml/v2 v2.4.2 ) diff --git a/go.sum b/go.sum index 90beaf7..3d57e46 100644 --- a/go.sum +++ b/go.sum @@ -1,21 +1,6 @@ -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/pelletier/go-toml/v2 v2.0.9 h1:uH2qQXheeefCCkuBBSLi7jCiSmj3VRh2+Goq2N7Xxu0= -github.com/pelletier/go-toml/v2 v2.0.9/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -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= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4= +github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= +go.yaml.in/yaml/v2 v2.4.2 h1:DzmwEr2rDGHl7lsFgAHxmNz/1NlQ7xLIrlN2h5d1eGI= +go.yaml.in/yaml/v2 v2.4.2/go.mod h1:081UH+NErpNdqlCXm3TtEran0rJZGxAYx9hb/ELlsPU= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=