code: func (q *Quantity) UnmarshalJSON(value []byte) error {
  	l := len(value)
  	if l == 4 && bytes.Equal(value, []byte("null")) {
  		q.d.Dec = nil
  		q.i = int64Amount{}
  		return nil
  	}
  	if l >= 2 && value[0] == '"' && value[l-1] == '"' {
  		value = value[1 : l-1]
  	}
  
  	parsed, err := ParseQuantity(strings.TrimSpace(string(value)))
  	if err != nil {
  		return err
  	}
  
  	// This copy is safe because parsed will not be referred to again.
  	*q = parsed
  	return nil
  }
docs: // UnmarshalJSON implements the json.Unmarshaller interface.
  // TODO: Remove support for leading/trailing whitespace