Skip to content

Commit

Permalink
Upgrade gopkg.io/yaml from v2 to v3 in schema (open-telemetry#4535)
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlias committed Sep 21, 2023
1 parent 975ca51 commit c9efe30
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions schema/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ go 1.20
require (
github.com/Masterminds/semver/v3 v3.2.1
github.com/stretchr/testify v1.8.4
gopkg.in/yaml.v2 v2.4.0
gopkg.in/yaml.v3 v3.0.1
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
2 changes: 0 additions & 2 deletions schema/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,5 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
4 changes: 2 additions & 2 deletions schema/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"io"
"os"

"gopkg.in/yaml.v2"
"gopkg.in/yaml.v3"
)

// ParseFile parses a Schema from the schema file found at path.
Expand All @@ -45,7 +45,7 @@ func ParseFile(path string) (*Schema, error) {
// If r contains an invalid schema URL an error will be returned.
func Parse(r io.Reader) (*Schema, error) {
d := yaml.NewDecoder(r)
d.SetStrict(true) // Do not silently drop unknown fields.
d.KnownFields(true)

var s Schema
if err := d.Decode(&s); err != nil {
Expand Down

0 comments on commit c9efe30

Please sign in to comment.