Simplify a condition

golangci-lint linter: ifshort

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
Miloslav Trmač 2023-02-02 21:28:10 +01:00
parent e7ab33e65f
commit 2a7b132790

View File

@ -576,8 +576,7 @@ func matchLayerBlobBinaryType(c *check.C, ociImageDirPath string, contentType st
func getFileContentType(out *os.File) (string, error) {
buffer := make([]byte, 512)
_, err := out.Read(buffer)
if err != nil {
if _, err := out.Read(buffer); err != nil {
return "", err
}
contentType := http.DetectContentType(buffer)