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 May 25, 2017
1 parent a0cf60c commit 24e9d17
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 @@ -140,7 +140,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 @@ -141,10 +141,12 @@ func testUnpackLayer(t *testing.T, compression string, invalid bool) {
}

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

testManifest := manifest{
Layers: []descriptor{descriptor{
MediaType: "application/vnd.oci.image.layer.v1.tar+gzip",
Digest: digester.Digest().String(),
}},
Layers: []descriptor{
{
MediaType: "application/vnd.oci.image.layer.v1.tar+gzip",
Digest: digester.Digest().String(),
},
},
}
err = testManifest.unpack(newPathWalker(tmp1), filepath.Join(tmp1, "rootfs"))
if err != nil && !strings.Contains(err.Error(), "duplicate entry for") {
Expand All @@ -225,6 +229,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 24e9d17

Please sign in to comment.