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 { ...@@ -531,10 +531,7 @@ func (d *Decoder) loadUnicode() error {
if err != nil { if err != nil {
return err return err
} }
_, err = buf.WriteRune(r) buf.WriteRune(r)
if err != nil {
return err
}
} }
if len(sline) > 0 { if len(sline) > 0 {
return fmt.Errorf("characters remaining after loadUnicode operation: %s", sline) 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