From c66e71bc84d0c8ff41a69a6c50634b8da6ed2ec6 Mon Sep 17 00:00:00 2001 From: Matthias Diester Date: Sun, 15 Mar 2026 10:48:49 +0100 Subject: [PATCH] Switch to `github.com/mitchellh/hashstructure/v2` Switch to v2. Signed-off-by: Matthias Diester --- go.mod | 2 +- go.sum | 4 ++-- pkg/dyff/core.go | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 200f2ec..69d5241 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/gonvenience/text v1.0.10 github.com/gonvenience/ytbx v1.4.8 github.com/lucasb-eyer/go-colorful v1.3.0 - github.com/mitchellh/hashstructure v1.1.0 + github.com/mitchellh/hashstructure/v2 v2.0.2 github.com/onsi/ginkgo/v2 v2.28.1 github.com/onsi/gomega v1.39.1 github.com/sergi/go-diff v1.4.0 diff --git a/go.sum b/go.sum index 51e9ecb..48a538f 100644 --- a/go.sum +++ b/go.sum @@ -64,8 +64,8 @@ github.com/mfridman/tparse v0.18.0 h1:wh6dzOKaIwkUGyKgOntDW4liXSo37qg5AXbIhkMV3v github.com/mfridman/tparse v0.18.0/go.mod h1:gEvqZTuCgEhPbYk/2lS3Kcxg1GmTxxU7kTC8DvP0i/A= github.com/mitchellh/go-ps v1.0.0 h1:i6ampVEEF4wQFF+bkYfwYgY+F/uYJDktmvLPf7qIgjc= github.com/mitchellh/go-ps v1.0.0/go.mod h1:J4lOc8z8yJs6vUwklHw2XEIiT4z4C40KtWVN3nvg8Pg= -github.com/mitchellh/hashstructure v1.1.0 h1:P6P1hdjqAAknpY/M1CGipelZgp+4y9ja9kmUZPXP+H0= -github.com/mitchellh/hashstructure v1.1.0/go.mod h1:xUDAozZz0Wmdiufv0uyhnHkUTN6/6d8ulp4AwfLKrmA= +github.com/mitchellh/hashstructure/v2 v2.0.2 h1:vGKWl0YJqUNxE8d+h8f6NJLcCJrgbhC4NcD46KavDd4= +github.com/mitchellh/hashstructure/v2 v2.0.2/go.mod h1:MG3aRVU/N29oo/V/IhBX8GR/zz4kQkprJgF2EVszyDE= github.com/onsi/ginkgo/v2 v2.28.1 h1:S4hj+HbZp40fNKuLUQOYLDgZLwNUVn19N3Atb98NCyI= github.com/onsi/ginkgo/v2 v2.28.1/go.mod h1:CLtbVInNckU3/+gC8LzkGUb9oF+e8W8TdUsxPwvdOgE= github.com/onsi/gomega v1.39.1 h1:1IJLAad4zjPn2PsnhH70V4DKRFlrCzGBNrNaru+Vf28= diff --git a/pkg/dyff/core.go b/pkg/dyff/core.go index 13d4084..3a57939 100644 --- a/pkg/dyff/core.go +++ b/pkg/dyff/core.go @@ -32,7 +32,7 @@ import ( "github.com/gonvenience/text" "github.com/gonvenience/ytbx" - "github.com/mitchellh/hashstructure" + "github.com/mitchellh/hashstructure/v2" yamlv3 "go.yaml.in/yaml/v3" ) @@ -1091,10 +1091,10 @@ func (compare *compare) calcNodeHash(node *yamlv3.Node) (hash uint64) { switch node.Kind { case yamlv3.MappingNode, yamlv3.SequenceNode: - hash, err = hashstructure.Hash(compare.basicType(node), nil) + hash, err = hashstructure.Hash(compare.basicType(node), hashstructure.FormatV2, nil) case yamlv3.ScalarNode: - hash, err = hashstructure.Hash(node.Tag+"/"+node.Value, nil) + hash, err = hashstructure.Hash(node.Tag+"/"+node.Value, hashstructure.FormatV2, nil) case yamlv3.AliasNode: hash = compare.calcNodeHash(followAlias(node))