1
0
mirror of https://github.com/golang/go synced 2024-09-24 19:30:12 -06:00

encoding/hex: add error check for write error.

I believe the original author of this code just forgot to check for error here.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/76760043
This commit is contained in:
Rui Ueyama 2014-03-17 12:07:30 -07:00 committed by Brad Fitzpatrick
parent 2940dd4bf4
commit 01d49dc2dd

View File

@ -146,6 +146,9 @@ func (h *dumper) Write(data []byte) (n int, err error) {
h.buf[12] = ' '
h.buf[13] = ' '
_, err = h.w.Write(h.buf[4:])
if err != nil {
return
}
}
Encode(h.buf[:], data[i:i+1])
h.buf[2] = ' '