fix tests to use location instead of file.Reference

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
This commit is contained in:
Alex Goodman
2020-11-17 12:37:12 -05:00
parent b694dacb21
commit aa0d444fd4
40 changed files with 327 additions and 382 deletions
+2 -9
View File
@@ -14,20 +14,13 @@ type Location struct {
ref file.Reference
}
func newLocation(path string) Location {
func NewLocation(path string) Location {
return Location{
Path: path,
}
}
func newLocationFromRef(ref file.Reference) Location {
return Location{
Path: string(ref.Path),
ref: ref,
}
}
func newLocationFromImage(ref file.Reference, img *image.Image) Location {
func NewLocationFromImage(ref file.Reference, img *image.Image) Location {
entry, err := img.FileCatalog.Get(ref)
if err != nil {
log.Warnf("unable to find file catalog entry for ref=%+v", ref)