github.com/anchore/syft@v1.4.2-0.20240516191711-1bec1fc5d397/internal/cmptest/location.go (about)

     1  package cmptest
     2  
     3  import (
     4  	"github.com/google/go-cmp/cmp"
     5  
     6  	"github.com/anchore/syft/syft/file"
     7  )
     8  
     9  type LocationComparer func(x, y file.Location) bool
    10  
    11  func DefaultLocationComparer(x, y file.Location) bool {
    12  	return cmp.Equal(x.Coordinates, y.Coordinates) && cmp.Equal(x.AccessPath, y.AccessPath)
    13  }