func (todo *Todo) Encode() (*bytes.Buffer, error) {
	b, err := json.Marshal(todo)
	if err != nil {
		return &bytes.Buffer{}, err
	}
	return bytes.NewBuffer(b), nil
}
// Encode marshals a Todo into a buffer.
Encode marshals a Todo into a buffer.
// Encode marshals a Todo into a buffer .
func (todo *Todo) Encode() (*bytes.Buffer, error) {
	b, err := json.Marshal(todo)
	if err != nil {
		return &bytes.Buffer{}, err
	}
	return bytes.NewBuffer(b), nil
}
func ( todo * Todo ) Encode ( ) ( * bytes . Buffer , error ) { b , err := json . Marshal ( todo ) if err != nil { return & bytes . Buffer { } , err } return bytes . NewBuffer ( b ) , nil }
Encode marshals a Todo into a buffer.
Encode marshals a Todo into a buffer .