diff --git a/base/server.go b/base/server.go index e69f7e6b..f21f6d13 100644 --- a/base/server.go +++ b/base/server.go @@ -345,7 +345,7 @@ func (s *Server) handlePProf(msg chat1.MsgSummary) error { // Cleanup after the file is sent. time.Sleep(time.Minute) s.Debug("cleaning up %s", outfile) - if err = os.Remove(outfile); err != nil && !os.IsNotExist(err) { + if err = os.Remove(outfile); err != nil { s.Errorf("unable to clean up %s: %v", outfile, err) } }() diff --git a/webhookbot/webhookbot/http.go b/webhookbot/webhookbot/http.go index a62eafd4..41c30412 100644 --- a/webhookbot/webhookbot/http.go +++ b/webhookbot/webhookbot/http.go @@ -119,7 +119,7 @@ func (h *HTTPSrv) handleHook(w http.ResponseWriter, r *http.Request) { // Cleanup after the file is sent. time.Sleep(time.Minute) h.Debug("cleaning up %s", filePath) - if err = os.Remove(filePath); err != nil && !os.IsNotExist(err) { + if err = os.Remove(filePath); err != nil { h.Errorf("unable to clean up %s: %v", filePath, err) } }()