Commit d266ce2f authored by Kirill Smelkov's avatar Kirill Smelkov

encoder: bytes.Buffer will never error on Write*()

This is explicitly stated in bytes.Buffer documentation and is already
relyed by ogórek in another place:

https://github.com/kisielk/og-rek/blob/c7dbf2e4/ogorek.go#L524
parent c7dbf2e4
......@@ -531,10 +531,7 @@ func (d *Decoder) loadUnicode() error {
if err != nil {
return err
}
_, err = buf.WriteRune(r)
if err != nil {
return err
}
buf.WriteRune(r)
}
if len(sline) > 0 {
return fmt.Errorf("characters remaining after loadUnicode operation: %s", sline)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment