1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-26 05:11:31 +00:00

remove a dump err

This commit is contained in:
JessonChan 2016-01-04 08:50:59 +08:00
parent 3ebf275157
commit d23291ccc7

View File

@ -47,9 +47,9 @@ type acceptEncoder struct {
bestCompressionPool *sync.Pool 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 { if ac.bestSpeedPool == nil || ac.bestCompressionPool == nil {
return nopResetWriter{wr}, nil return nopResetWriter{wr}
} }
var rwr resetWriter var rwr resetWriter
switch level { switch level {
@ -61,7 +61,7 @@ func (ac acceptEncoder) encode(wr io.Writer, level int) (resetWriter, error) {
rwr = ac.levelEncode(level) rwr = ac.levelEncode(level)
} }
rwr.Reset(wr) rwr.Reset(wr)
return rwr, nil return rwr
} }
func (ac acceptEncoder) put(wr resetWriter, level int) { 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 ce = cf
} }
encoding = ce.name encoding = ce.name
outputWriter, err = ce.encode(writer, level) outputWriter = ce.encode(writer, level)
defer ce.put(outputWriter, level) defer ce.put(outputWriter, level)
if err != nil {
return false, "", err
}
_, err = io.Copy(outputWriter, reader) _, err = io.Copy(outputWriter, reader)
if err != nil { if err != nil {
return false, "", err return false, "", err