mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
tech(cli): dont use defer statements in loops
This commit is contained in:
parent
5abaf26b5f
commit
903d1b7797
@ -164,14 +164,14 @@ func downloadFile(pluginName, filePath, url string) (err error) {
|
||||
return fmt.Errorf(permissionsDeniedMessage, newFile)
|
||||
}
|
||||
|
||||
defer dst.Close()
|
||||
src, err := zf.Open()
|
||||
if err != nil {
|
||||
log.Errorf("%v", err)
|
||||
}
|
||||
defer src.Close()
|
||||
|
||||
io.Copy(dst, src)
|
||||
dst.Close()
|
||||
src.Close()
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user