File tree Expand file tree Collapse file tree 5 files changed +14
-16
lines changed
Expand file tree Collapse file tree 5 files changed +14
-16
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ require (
77 github.com/fatih/color v1.16.0
88 github.com/google/go-cmp v0.6.0
99 golang.org/x/mod v0.14.0
10- gopkg.in/yaml.v2 v2.4.0
10+ gopkg.in/yaml.v3 v3.0.1
1111)
1212
1313require (
Original file line number Diff line number Diff line change @@ -17,5 +17,5 @@ golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q=
1717golang.org/x/sys v0.14.0 /go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA =
1818gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM =
1919gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 /go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0 =
20- gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY =
21- gopkg.in/yaml.v2 v2.4.0 /go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ =
20+ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA =
21+ gopkg.in/yaml.v3 v3.0.1 /go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM =
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import (
1010
1111 "github.com/g-rath/osv-detector/internal/reporter"
1212 "github.com/g-rath/osv-detector/pkg/database"
13- "gopkg.in/yaml.v2 "
13+ "gopkg.in/yaml.v3 "
1414)
1515
1616type rawDatabaseConfig struct {
@@ -21,7 +21,7 @@ type rawDatabaseConfig struct {
2121}
2222
2323type rawConfig struct {
24- FilePath string
24+ FilePath string `yaml:"-"`
2525 Ignore []string `yaml:"ignore"`
2626 Databases []rawDatabaseConfig `yaml:"extra-databases"`
2727}
Original file line number Diff line number Diff line change 77 "strings"
88
99 "github.com/g-rath/osv-detector/internal/cachedregexp"
10- "gopkg.in/yaml.v2 "
10+ "gopkg.in/yaml.v3 "
1111)
1212
1313type PnpmLockPackageResolution struct {
@@ -33,11 +33,11 @@ type pnpmLockfileV6 struct {
3333 Packages map [string ]PnpmLockPackage `yaml:"packages,omitempty"`
3434}
3535
36- func (l * PnpmLockfile ) UnmarshalYAML (unmarshal func ( any ) error ) error {
36+ func (l * PnpmLockfile ) UnmarshalYAML (value * yaml. Node ) error {
3737 var lockfileV6 pnpmLockfileV6
3838
39- if err := unmarshal (& lockfileV6 ); err != nil {
40- return err
39+ if err := value . Decode (& lockfileV6 ); err != nil {
40+ return fmt . Errorf ( "%w" , err )
4141 }
4242
4343 parsedVersion , err := strconv .ParseFloat (lockfileV6 .Version , 64 )
Original file line number Diff line number Diff line change 44 "fmt"
55 "os"
66
7- "gopkg.in/yaml.v2 "
7+ "gopkg.in/yaml.v3 "
88)
99
1010type PubspecLockDescription struct {
@@ -14,17 +14,15 @@ type PubspecLockDescription struct {
1414 Ref string `yaml:"resolved-ref"`
1515}
1616
17- var _ yaml.Unmarshaler = & PubspecLockDescription {}
18-
19- func (pld * PubspecLockDescription ) UnmarshalYAML (unmarshal func (any ) error ) error {
17+ func (pld * PubspecLockDescription ) UnmarshalYAML (value * yaml.Node ) error {
2018 var m struct {
2119 Name string `yaml:"name"`
2220 URL string `yaml:"url"`
2321 Path string `yaml:"path"`
2422 Ref string `yaml:"resolved-ref"`
2523 }
2624
27- err := unmarshal (& m )
25+ err := value . Decode (& m )
2826
2927 if err == nil {
3028 pld .Name = m .Name
@@ -37,10 +35,10 @@ func (pld *PubspecLockDescription) UnmarshalYAML(unmarshal func(any) error) erro
3735
3836 var str * string
3937
40- err = unmarshal (& str )
38+ err = value . Decode (& str )
4139
4240 if err != nil {
43- return err
41+ return fmt . Errorf ( "%w" , err )
4442 }
4543
4644 pld .Path = * str
You can’t perform that action at this time.
0 commit comments