Remove mitchellh dependencies (#3748)

* remove mitchellh dependencies

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

* fix failing unit tests

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

---------

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
This commit is contained in:
Alex Goodman
2025-03-20 10:19:19 -04:00
committed by GitHub
parent 35d666b27d
commit e9b24a29d7
30 changed files with 132 additions and 119 deletions
+2 -2
View File
@@ -3,7 +3,7 @@ package file
import (
"sort"
"github.com/mitchellh/hashstructure/v2"
"github.com/gohugoio/hashstructure"
"github.com/scylladb/go-set/strset"
)
@@ -79,7 +79,7 @@ func (s CoordinateSet) ToSlice() []Coordinates {
}
func (s CoordinateSet) Hash() (uint64, error) {
return hashstructure.Hash(s.ToSlice(), hashstructure.FormatV2, &hashstructure.HashOptions{
return hashstructure.Hash(s.ToSlice(), &hashstructure.HashOptions{
ZeroNil: true,
SlicesAsSets: true,
})
+2 -2
View File
@@ -3,7 +3,7 @@ package file
import (
"sort"
"github.com/mitchellh/hashstructure/v2"
"github.com/gohugoio/hashstructure"
"github.com/anchore/syft/internal/log"
)
@@ -91,7 +91,7 @@ func (s *LocationSet) Empty() bool {
func (s LocationSet) Hash() (uint64, error) {
// access paths and filesystem IDs are not considered when hashing a location set, only the real paths
return hashstructure.Hash(s.CoordinateSet().Paths(), hashstructure.FormatV2, &hashstructure.HashOptions{
return hashstructure.Hash(s.CoordinateSet().Paths(), &hashstructure.HashOptions{
ZeroNil: true,
SlicesAsSets: true,
})