Update coders with error return values
This commit is contained in:
@@ -4,10 +4,11 @@ import "bytes"
|
||||
|
||||
type ASCIICoder struct{}
|
||||
|
||||
func (c *ASCIICoder) Encode(s string, buf *bytes.Buffer) {
|
||||
func (c *ASCIICoder) Encode(s string, buf *bytes.Buffer) error {
|
||||
buf.WriteString(s)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *ASCIICoder) Decode(buf *bytes.Buffer) string {
|
||||
return buf.String()
|
||||
func (c *ASCIICoder) Decode(buf *bytes.Buffer) (string, error) {
|
||||
return buf.String(), nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user