arguments.go
func (r ArgReadHelper) ReadJSON(data interface{}) error {
	return r.read(func() error {
		// TChannel allows for 0 length values (not valid JSON), so we use a bufio.Reader
		// to check whether data is of 0 length.
		reader := bufio.NewReader(r.reader)
		if _, err := reader.Peek(1); err == io.EOF {
			// If the data is 0 length, then we don't try to read anything.
			return nil
		} else if err != nil {
			return err
		}

		d := json.NewDecoder(reader)
		return d.Decode(data)
	})
}
func (r ArgReadHelper) ReadJSON(data interface{}) error {
	return r.read(func() error {
		// TChannel allows for 0 length values (not valid JSON), so we use a bufio.Reader
		// to check whether data is of 0 length.
		reader := bufio.NewReader(r.reader)
		if _, err := reader.Peek(1); err == io.EOF {
			// If the data is 0 length, then we don't try to read anything.
			return nil
		} else if err != nil {
			return err
		}

		d := json.NewDecoder(reader)
		return d.Decode(data)
	})
}
// ReadJSON deserializes JSON from the underlying reader into data.