Skip to content

Commit

Permalink
tiny fix: format code and tfix
Browse files Browse the repository at this point in the history
Signed-off-by: Ma Shimiao <[email protected]>
  • Loading branch information
Ma Shimiao committed Jun 21, 2017
1 parent 2d16afd commit 9d23ffd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion image/image_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func TestValidateLayout(t *testing.T) {
manifest: manifestStr,
config: configStr,
tarList: []tarContent{
tarContent{&tar.Header{Name: "test", Size: 4, Mode: 0600}, []byte("test")},
{&tar.Header{Name: "test", Size: 4, Mode: 0600}, []byte("test")},
},
}

Expand Down
22 changes: 13 additions & 9 deletions image/manifest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,12 @@ func testUnpackLayer(t *testing.T, compression string, invalid bool) {
}

testManifest := manifest{
Layers: []v1.Descriptor{v1.Descriptor{
MediaType: mediatype,
Digest: digester.Digest(),
}},
Layers: []v1.Descriptor{
{
MediaType: mediatype,
Digest: digester.Digest(),
},
},
}
err = testManifest.unpack(newPathWalker(tmp1), filepath.Join(tmp1, "rootfs"))
if err != nil {
Expand Down Expand Up @@ -211,10 +213,12 @@ func TestUnpackLayerRemovePartialyUnpackedFile(t *testing.T) {
}

testManifest := manifest{
Layers: []v1.Descriptor{v1.Descriptor{
MediaType: "application/vnd.oci.image.layer.v1.tar+gzip",
Digest: digester.Digest(),
}},
Layers: []v1.Descriptor{
{
MediaType: "application/vnd.oci.image.layer.v1.tar+gzip",
Digest: digester.Digest(),
},
},
}
err = testManifest.unpack(newPathWalker(tmp1), filepath.Join(tmp1, "rootfs"))
if err != nil && !strings.Contains(err.Error(), "duplicate entry for") {
Expand All @@ -226,6 +230,6 @@ func TestUnpackLayerRemovePartialyUnpackedFile(t *testing.T) {
t.Fatal(err)
}
if err == nil {
t.Fatal("Execpt partialy unpacked file has been removed")
t.Fatal("Except partially unpacked file has been removed")
}
}

0 comments on commit 9d23ffd

Please sign in to comment.