From 629fe6afbe788e679dc381451ab395f3066721c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= Date: Mon, 6 Jan 2025 18:01:16 +0100 Subject: [PATCH] Add a comment justifying lack of unit test coverage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... to reinforce the rule that *_transport.go needs to have comprehensive unit tests, to the fullest possible extent. Signed-off-by: Miloslav Trmač --- oci/layout/oci_transport.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oci/layout/oci_transport.go b/oci/layout/oci_transport.go index 9cdbe292f..6ab384676 100644 --- a/oci/layout/oci_transport.go +++ b/oci/layout/oci_transport.go @@ -219,7 +219,7 @@ func (ref ociReference) getManifestDescriptor() (imgspecv1.Descriptor, int, erro } switch { - case ref.image != "" && ref.sourceIndex != -1: + case ref.image != "" && ref.sourceIndex != -1: // Coverage: newReference refuses to create such references. return imgspecv1.Descriptor{}, -1, fmt.Errorf("Internal error: Cannot have both ref %s and source index @%d", ref.image, ref.sourceIndex)