address lint and gofmt issues

Signed-off-by: Mike Brown <brownwm@us.ibm.com>
This commit is contained in:
Mike Brown 2018-06-19 13:48:42 -05:00
parent 321d636e76
commit e8d7941ca6
3 changed files with 5 additions and 5 deletions

View File

@ -154,7 +154,7 @@ func FromDescriptors(descriptors []ManifestDescriptor) (*DeserializedManifestLis
return FromDescriptorsWithMediaType(descriptors, mediaType) 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) { func FromDescriptorsWithMediaType(descriptors []ManifestDescriptor, mediaType string) (*DeserializedManifestList, error) {
m := ManifestList{ m := ManifestList{
Versioned: manifest.Versioned{ Versioned: manifest.Versioned{

View File

@ -9,7 +9,7 @@ import (
"github.com/opencontainers/image-spec/specs-go/v1" "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 { type Builder struct {
// bs is a BlobService used to publish the configuration blob. // bs is a BlobService used to publish the configuration blob.
bs distribution.BlobService bs distribution.BlobService
@ -43,8 +43,8 @@ func NewManifestBuilder(bs distribution.BlobService, configJSON []byte, annotati
return mb return mb
} }
// For testing purposes, we want to be able to create an OCI image with // SetMediaType assigns the passed mediatype or error if the mediatype is not a
// either an MediaType either empty, or with the OCI image value // valid media type for oci image manifests currently: "" or "application/vnd.oci.image.manifest.v1+json"
func (mb *Builder) SetMediaType(mediaType string) { func (mb *Builder) SetMediaType(mediaType string) {
if mediaType != "" && mediaType != v1.MediaTypeImageManifest { if mediaType != "" && mediaType != v1.MediaTypeImageManifest {
panic("Invalid media type for OCI image manifest") panic("Invalid media type for OCI image manifest")

View File

@ -440,7 +440,7 @@ func testOCIManifestStorage(t *testing.T, testname string, includeMediaTypes boo
} }
manifestDescriptors := []manifestlist.ManifestDescriptor{ manifestDescriptors := []manifestlist.ManifestDescriptor{
manifestlist.ManifestDescriptor{ {
Descriptor: descriptor, Descriptor: descriptor,
Platform: platformSpec, Platform: platformSpec,
}, },