mirror of
https://github.com/containers/skopeo.git
synced 2025-08-12 19:56:17 +00:00
Use strings.CutSuffix
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
parent
4a43163fba
commit
a75ed81668
@ -268,8 +268,8 @@ func decompressDir(t *testing.T, dir string) {
|
|||||||
rawLayer["size"] = uncompressedSize
|
rawLayer["size"] = uncompressedSize
|
||||||
var mimeType string
|
var mimeType string
|
||||||
getRawMapField(t, rawLayer, "mediaType", &mimeType)
|
getRawMapField(t, rawLayer, "mediaType", &mimeType)
|
||||||
if strings.HasSuffix(mimeType, ".gzip") { // This should use CutSuffix with Go ≥1.20
|
if uncompressedMIMEType, ok := strings.CutSuffix(mimeType, ".gzip"); ok {
|
||||||
rawLayer["mediaType"] = strings.TrimSuffix(mimeType, ".gzip")
|
rawLayer["mediaType"] = uncompressedMIMEType
|
||||||
}
|
}
|
||||||
|
|
||||||
rawLayers[i] = rawLayer
|
rawLayers[i] = rawLayer
|
||||||
|
Loading…
Reference in New Issue
Block a user