From d23291ccc783f9613f9d0bc848ca6b382c65b649 Mon Sep 17 00:00:00 2001 From: JessonChan Date: Mon, 4 Jan 2016 08:50:59 +0800 Subject: [PATCH] remove a dump err --- context/acceptencoder.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/context/acceptencoder.go b/context/acceptencoder.go index 7d4b2dbe..07c5cb0b 100644 --- a/context/acceptencoder.go +++ b/context/acceptencoder.go @@ -47,9 +47,9 @@ type acceptEncoder struct { bestCompressionPool *sync.Pool } -func (ac acceptEncoder) encode(wr io.Writer, level int) (resetWriter, error) { +func (ac acceptEncoder) encode(wr io.Writer, level int) resetWriter { if ac.bestSpeedPool == nil || ac.bestCompressionPool == nil { - return nopResetWriter{wr}, nil + return nopResetWriter{wr} } var rwr resetWriter switch level { @@ -61,7 +61,7 @@ func (ac acceptEncoder) encode(wr io.Writer, level int) (resetWriter, error) { rwr = ac.levelEncode(level) } rwr.Reset(wr) - return rwr, nil + return rwr } func (ac acceptEncoder) put(wr resetWriter, level int) { @@ -134,13 +134,9 @@ func writeLevel(encoding string, writer io.Writer, reader io.Reader, level int) ce = cf } encoding = ce.name - outputWriter, err = ce.encode(writer, level) + outputWriter = ce.encode(writer, level) defer ce.put(outputWriter, level) - if err != nil { - return false, "", err - } - _, err = io.Copy(outputWriter, reader) if err != nil { return false, "", err