Skip to content

Commit

Permalink
Add a comment justifying lack of unit test coverage
Browse files Browse the repository at this point in the history
... to reinforce the rule that *_transport.go needs to have comprehensive
unit tests, to the fullest possible extent.

Signed-off-by: Miloslav Trmač <[email protected]>
  • Loading branch information
mtrmac committed Jan 6, 2025
1 parent fdddcb1 commit 629fe6a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion oci/layout/oci_transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 629fe6a

Please sign in to comment.