Skip to content

Commit 9d23ffd

Browse files
author
Ma Shimiao
committed
tiny fix: format code and tfix
Signed-off-by: Ma Shimiao <[email protected]>
1 parent 2d16afd commit 9d23ffd

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

image/image_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ func TestValidateLayout(t *testing.T) {
175175
manifest: manifestStr,
176176
config: configStr,
177177
tarList: []tarContent{
178-
tarContent{&tar.Header{Name: "test", Size: 4, Mode: 0600}, []byte("test")},
178+
{&tar.Header{Name: "test", Size: 4, Mode: 0600}, []byte("test")},
179179
},
180180
}
181181

image/manifest_test.go

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,12 @@ func testUnpackLayer(t *testing.T, compression string, invalid bool) {
142142
}
143143

144144
testManifest := manifest{
145-
Layers: []v1.Descriptor{v1.Descriptor{
146-
MediaType: mediatype,
147-
Digest: digester.Digest(),
148-
}},
145+
Layers: []v1.Descriptor{
146+
{
147+
MediaType: mediatype,
148+
Digest: digester.Digest(),
149+
},
150+
},
149151
}
150152
err = testManifest.unpack(newPathWalker(tmp1), filepath.Join(tmp1, "rootfs"))
151153
if err != nil {
@@ -211,10 +213,12 @@ func TestUnpackLayerRemovePartialyUnpackedFile(t *testing.T) {
211213
}
212214

213215
testManifest := manifest{
214-
Layers: []v1.Descriptor{v1.Descriptor{
215-
MediaType: "application/vnd.oci.image.layer.v1.tar+gzip",
216-
Digest: digester.Digest(),
217-
}},
216+
Layers: []v1.Descriptor{
217+
{
218+
MediaType: "application/vnd.oci.image.layer.v1.tar+gzip",
219+
Digest: digester.Digest(),
220+
},
221+
},
218222
}
219223
err = testManifest.unpack(newPathWalker(tmp1), filepath.Join(tmp1, "rootfs"))
220224
if err != nil && !strings.Contains(err.Error(), "duplicate entry for") {
@@ -226,6 +230,6 @@ func TestUnpackLayerRemovePartialyUnpackedFile(t *testing.T) {
226230
t.Fatal(err)
227231
}
228232
if err == nil {
229-
t.Fatal("Execpt partialy unpacked file has been removed")
233+
t.Fatal("Except partially unpacked file has been removed")
230234
}
231235
}

0 commit comments

Comments
 (0)