Skip to content

Commit f1063a6

Browse files
committed
Consistent result types/names
One function had named return values, keep is consistent with other functions. Signed-off-by: Pieter De Gendt <[email protected]>
1 parent 12e871f commit f1063a6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cobs.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,16 +96,16 @@ func (e *Encoder) Close() error {
9696
}
9797

9898
// Encode encodes and returns a byte slice.
99-
func Encode(data []byte) (enc []byte, err error) {
99+
func Encode(data []byte) ([]byte, error) {
100100
// Reserve a buffer with overhead room
101101
buf := bytes.NewBuffer(make([]byte, 0, len(data) + (len(data) + 253) / 254))
102102
e := NewEncoder(buf)
103103

104-
if _, err = e.Write(data); err != nil {
104+
if _, err := e.Write(data); err != nil {
105105
return buf.Bytes(), err
106106
}
107107

108-
err = e.Close()
108+
err := e.Close()
109109

110110
return buf.Bytes(), err
111111
}

0 commit comments

Comments
 (0)