From 1749c8fae7aba01a224299df49ced7828c288589 Mon Sep 17 00:00:00 2001 From: tomsweeneyredhat Date: Wed, 16 Jul 2025 20:48:02 -0400 Subject: [PATCH] A few small lint issues When creating c/common v0.64.0, I found a lot of "hot air" lint issues, but also three smal nitty ones. This fixes the nits. Signed-off-by: tomsweeneyredhat --- internal/deepcopy.go | 2 +- pkg/manifests/manifests_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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) } }