func (e *Encoder) Encode() (io.ReadSeeker, error) {
	b, err := e.encode()
	if err != nil {
		return nil, err
	}
	if len(b) == 2 {
		return nil, nil
	}
	return bytes.NewReader(b), nil
}
Encode returns the encoded XMl reader. An error will be returned if one was
encountered while building the JSON body.
package json
import (
	"bytes"
	"fmt"
	"io"
	"github.com/aws/aws-sdk-go-v2/private/protocol"
)
type Encoder struct {
	encoder
	root bool
}
func NewEncoder() *Encoder {
	buf := bytes.NewBuffer([]byte{'{'})
	e := &Encoder{
		encoder: encoder{
			buf:      buf,
			parent:   nil,
			fieldBuf: &protocol.FieldBuffer{},
		},
		root: true,
	}
	return e
}