From e2707de1bcbfb3cbc32042ce63a44b573304fb2f Mon Sep 17 00:00:00 2001 From: Tom Bevan Date: Wed, 18 Jan 2023 12:36:21 +0000 Subject: [PATCH] update msgpack --- diff.go | 2 +- diff_map.go | 2 +- go.mod | 5 ++--- go.sum | 25 ++++++++----------------- patch_map.go | 9 +++++---- 5 files changed, 17 insertions(+), 26 deletions(-) diff --git a/diff.go b/diff.go index 64e3dcd..3c2ba17 100644 --- a/diff.go +++ b/diff.go @@ -11,7 +11,7 @@ import ( "strconv" "strings" - "github.com/vmihailenco/msgpack" + "github.com/vmihailenco/msgpack/v5" ) const ( diff --git a/diff_map.go b/diff_map.go index 02b1c1b..675ff93 100644 --- a/diff_map.go +++ b/diff_map.go @@ -8,7 +8,7 @@ import ( "fmt" "reflect" - "github.com/vmihailenco/msgpack" + "github.com/vmihailenco/msgpack/v5" ) func (d *Differ) diffMap(path []string, a, b reflect.Value, parent interface{}) error { diff --git a/go.mod b/go.mod index 216a3b5..ccf2fc9 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,6 @@ module github.com/r3labs/diff/v3 go 1.13 require ( - github.com/stretchr/testify v1.5.1 - github.com/vmihailenco/msgpack v4.0.4+incompatible - google.golang.org/appengine v1.6.6 // indirect + github.com/stretchr/testify v1.6.1 + github.com/vmihailenco/msgpack/v5 v5.3.5 ) diff --git a/go.sum b/go.sum index 9426b74..d48fa03 100644 --- a/go.sum +++ b/go.sum @@ -1,24 +1,15 @@ github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 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/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= -github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI= -github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65 h1:+rhAzEzT3f4JtomfC371qB+0Ola2caSKcY69NUBZrRQ= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/vmihailenco/msgpack/v5 v5.3.5 h1:5gO0H1iULLWGhs2H5tbAHIZTV8/cYafcFOr9znI5mJU= +github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= +github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= +github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= 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.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/patch_map.go b/patch_map.go index 8a3906a..6c3f035 100644 --- a/patch_map.go +++ b/patch_map.go @@ -4,10 +4,10 @@ import ( "errors" "reflect" - "github.com/vmihailenco/msgpack" + "github.com/vmihailenco/msgpack/v5" ) -//renderMap - handle map rendering for patch +// renderMap - handle map rendering for patch func (d *Differ) renderMap(c *ChangeValue) (m, k, v *reflect.Value) { //we must tease out the type of the key, we use the msgpack from diff to recreate the key kt := c.target.Type().Key() @@ -68,8 +68,9 @@ func (d *Differ) renderMap(c *ChangeValue) (m, k, v *reflect.Value) { } // updateMapEntry - deletes are special, they are handled differently based on options -// container type etc. We have to have special handling for each -// type. Set values are more generic even if they must be instanced +// +// container type etc. We have to have special handling for each +// type. Set values are more generic even if they must be instanced func (d *Differ) updateMapEntry(c *ChangeValue, m, k, v *reflect.Value) { if k == nil || m == nil { return