code: func (intstr IntOrString) MarshalJSON() ([]byte, error) {
  	switch intstr.Type {
  	case Int:
  		return json.Marshal(intstr.IntVal)
  	case String:
  		return json.Marshal(intstr.StrVal)
  	default:
  		return []byte{}, fmt.Errorf("impossible IntOrString.Type")
  	}
  }
docs: // MarshalJSON implements the json.Marshaller interface.