From e8d7941ca6a90ada87caaa9affb67565309aeeba Mon Sep 17 00:00:00 2001 From: Mike Brown Date: Tue, 19 Jun 2018 13:48:42 -0500 Subject: [PATCH] address lint and gofmt issues Signed-off-by: Mike Brown --- manifest/manifestlist/manifestlist.go | 2 +- manifest/ocischema/builder.go | 6 +++--- registry/storage/manifeststore_test.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/manifest/manifestlist/manifestlist.go b/manifest/manifestlist/manifestlist.go index a08f1e5a..f4e915ee 100644 --- a/manifest/manifestlist/manifestlist.go +++ b/manifest/manifestlist/manifestlist.go @@ -154,7 +154,7 @@ func FromDescriptors(descriptors []ManifestDescriptor) (*DeserializedManifestLis return FromDescriptorsWithMediaType(descriptors, mediaType) } -// For testing purposes, it's useful to be able to specify the media type explicitly +// FromDescriptorsWithMediaType is for testing purposes, it's useful to be able to specify the media type explicitly func FromDescriptorsWithMediaType(descriptors []ManifestDescriptor, mediaType string) (*DeserializedManifestList, error) { m := ManifestList{ Versioned: manifest.Versioned{ diff --git a/manifest/ocischema/builder.go b/manifest/ocischema/builder.go index 22a53c0d..c189a16e 100644 --- a/manifest/ocischema/builder.go +++ b/manifest/ocischema/builder.go @@ -9,7 +9,7 @@ import ( "github.com/opencontainers/image-spec/specs-go/v1" ) -// builder is a type for constructing manifests. +// Builder is a type for constructing manifests. type Builder struct { // bs is a BlobService used to publish the configuration blob. bs distribution.BlobService @@ -43,8 +43,8 @@ func NewManifestBuilder(bs distribution.BlobService, configJSON []byte, annotati return mb } -// For testing purposes, we want to be able to create an OCI image with -// either an MediaType either empty, or with the OCI image value +// SetMediaType assigns the passed mediatype or error if the mediatype is not a +// valid media type for oci image manifests currently: "" or "application/vnd.oci.image.manifest.v1+json" func (mb *Builder) SetMediaType(mediaType string) { if mediaType != "" && mediaType != v1.MediaTypeImageManifest { panic("Invalid media type for OCI image manifest") diff --git a/registry/storage/manifeststore_test.go b/registry/storage/manifeststore_test.go index 61a4beee..6e583c53 100644 --- a/registry/storage/manifeststore_test.go +++ b/registry/storage/manifeststore_test.go @@ -440,7 +440,7 @@ func testOCIManifestStorage(t *testing.T, testname string, includeMediaTypes boo } manifestDescriptors := []manifestlist.ManifestDescriptor{ - manifestlist.ManifestDescriptor{ + { Descriptor: descriptor, Platform: platformSpec, },