3// similar between ../moxio/limitreader.go and ../webapi/limitreader.go
10var ErrLimit = errors.New("input exceeds maximum size") // Returned by LimitReader.
12// LimitReader reads up to Limit bytes, returning an error if more bytes are
13// read. LimitReader can be used to enforce a maximum input length.
14type LimitReader struct {
19// Read reads bytes from the underlying reader.
20func (r *LimitReader) Read(buf []byte) (int, error) {
21 n, err := r.R.Read(buf)