code: func (q Quantity) MarshalJSON() ([]byte, error) {
  	if len(q.s) > 0 {
  		out := make([]byte, len(q.s)+2)
  		out[0], out[len(out)-1] = '"', '"'
  		copy(out[1:], q.s)
  		return out, nil
  	}
  	result := make([]byte, int64QuantityExpectedBytes, int64QuantityExpectedBytes)
  	result[0] = '"'
  	number, suffix := q.CanonicalizeBytes(result[1:1])
  	// if the same slice was returned to us that we passed in, avoid another allocation by copying number into
  	// the source slice and returning that
  	if len(number) > 0 && &number[0] == &result[1] && (len(number)+len(suffix)+2) <= int64QuantityExpectedBytes {
  		number = append(number, suffix...)
  		number = append(number, '"')
  		return result[:1+len(number)], nil
  	}
  	// if CanonicalizeBytes needed more space than our slice provided, we may need to allocate again so use
  	// append
  	result = result[:1]
  	result = append(result, number...)
  	result = append(result, suffix...)
  	result = append(result, '"')
  	return result, nil
  }
docs: // MarshalJSON implements the json.Marshaller interface.