From 47112aa5d62c71570d920f355a66d12d19fe5abd Mon Sep 17 00:00:00 2001 From: Vilmos Nebehaj Date: Mon, 20 Jan 2020 13:23:36 -0800 Subject: [PATCH] Use correct Flush() prototype from http.Flusher When calling GetContainerLogs(), a type check is performed to see if the http.ResponseWriter supports flushing. However, Flush() in http.Flusher does not return an error, therefore the type check will always fail. Fix the flushWriter helper interface so flushing the writer will work. --- node/api/helpers.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/node/api/helpers.go b/node/api/helpers.go index 1af574d23..2051d9cb0 100644 --- a/node/api/helpers.go +++ b/node/api/helpers.go @@ -56,16 +56,14 @@ type flushWriter struct { } type writeFlusher interface { - Flush() error + Flush() Write([]byte) (int, error) } func (fw *flushWriter) Write(p []byte) (int, error) { n, err := fw.w.Write(p) if n > 0 { - if err := fw.w.Flush(); err != nil { - return n, err - } + fw.w.Flush() } return n, err }