mirror of
https://github.com/containers/skopeo.git
synced 2025-05-06 15:06:27 +00:00
Simplify a condition
golangci-lint linter: ifshort Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
parent
e7ab33e65f
commit
2a7b132790
@ -576,8 +576,7 @@ func matchLayerBlobBinaryType(c *check.C, ociImageDirPath string, contentType st
|
|||||||
|
|
||||||
func getFileContentType(out *os.File) (string, error) {
|
func getFileContentType(out *os.File) (string, error) {
|
||||||
buffer := make([]byte, 512)
|
buffer := make([]byte, 512)
|
||||||
_, err := out.Read(buffer)
|
if _, err := out.Read(buffer); err != nil {
|
||||||
if err != nil {
|
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
contentType := http.DetectContentType(buffer)
|
contentType := http.DetectContentType(buffer)
|
||||||
|
Loading…
Reference in New Issue
Block a user