diff --git a/internal/deepcopy.go b/internal/deepcopy.go index d000bd947..690b68fbe 100644 --- a/internal/deepcopy.go +++ b/internal/deepcopy.go @@ -7,7 +7,7 @@ import ( v1 "github.com/opencontainers/image-spec/specs-go/v1" ) -// DeepCopyDescriptor copies a Descriptor, deeply copying its contents +// DeepCopyDescriptor copies a Descriptor, deeply copying its contents. func DeepCopyDescriptor(original *v1.Descriptor) *v1.Descriptor { tmp := *original if original.URLs != nil { diff --git a/pkg/manifests/manifests_test.go b/pkg/manifests/manifests_test.go index 2f2adae4e..a9f7d3301 100644 --- a/pkg/manifests/manifests_test.go +++ b/pkg/manifests/manifests_test.go @@ -105,10 +105,10 @@ func TestAddInstance(t *testing.T) { t.Fatalf("adding an instance without platform info failed in %s: %v", version, err) } o, err := list.findOCIv1(manifestDigest) - if o == nil || err != nil { + if err != nil { t.Fatalf("adding an instance failed in %s: %v", version, err) } - if o.Platform != nil { + if o != nil && o.Platform != nil { t.Fatalf("added a Platform field (%+v) where none was expected: %v", o.Platform, err) } }