chore: fix lint error
This commit is contained in:
parent
0f2835fbb6
commit
9f216e21ac
@ -240,7 +240,7 @@ func (i *FileInfo) detectType(modify, saveContent, readHeader bool) error {
|
|||||||
case strings.HasPrefix(mimetype, "audio"):
|
case strings.HasPrefix(mimetype, "audio"):
|
||||||
i.Type = "audio"
|
i.Type = "audio"
|
||||||
return nil
|
return nil
|
||||||
case strings.HasPrefix(mimetype, "image"), strings.HasPrefix(mimetype, "video"):
|
case strings.HasPrefix(mimetype, "image"):
|
||||||
i.Type = "image"
|
i.Type = "image"
|
||||||
resolution, err := calculateImageResolution(i.Fs, i.Path)
|
resolution, err := calculateImageResolution(i.Fs, i.Path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -281,12 +281,11 @@ func calculateImageResolution(fs afero.Fs, path string) (*ImageResolution, error
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
defer func(file afero.File) {
|
defer func() {
|
||||||
err := file.Close()
|
if cErr := file.Close(); cErr != nil {
|
||||||
if err != nil {
|
log.Printf("Failed to close file: %v", cErr)
|
||||||
|
|
||||||
}
|
}
|
||||||
}(file)
|
}()
|
||||||
|
|
||||||
config, _, err := image.DecodeConfig(file)
|
config, _, err := image.DecodeConfig(file)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user