From f372964a60b9ee119af6f5cef57c0658971d46f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Thu, 1 Apr 2021 16:40:11 +0200 Subject: [PATCH] fix lint --- extern/sector-storage/stores/http_handler.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/extern/sector-storage/stores/http_handler.go b/extern/sector-storage/stores/http_handler.go index 9e927cb06..3e3468470 100644 --- a/extern/sector-storage/stores/http_handler.go +++ b/extern/sector-storage/stores/http_handler.go @@ -117,7 +117,11 @@ func (handler *FetchHandler) remoteGetSector(w http.ResponseWriter, r *http.Requ return } if !stat.IsDir() { - defer rd.(*os.File).Close() + defer func() { + if err := rd.(*os.File).Close(); err != nil { + log.Errorf("closing source file: %+v", err) + } + }() } w.WriteHeader(200)