(caseType reflect.Type, caseTypeID TypeId, defaultTypeID TypeId)
| 341 | } |
| 342 | |
| 343 | func needsUnionEncodingOverride(caseType reflect.Type, caseTypeID TypeId, defaultTypeID TypeId) bool { |
| 344 | if caseTypeID == defaultTypeID { |
| 345 | return false |
| 346 | } |
| 347 | base := caseType |
| 348 | if base.Kind() == reflect.Ptr { |
| 349 | base = base.Elem() |
| 350 | } |
| 351 | switch base.Kind() { |
| 352 | case reflect.Int32, reflect.Uint32, reflect.Int64, reflect.Uint64: |
| 353 | if isNumericEncodingTypeID(caseTypeID) { |
| 354 | if defaultTypeID == 0 || isNumericEncodingTypeID(defaultTypeID) { |
| 355 | return true |
| 356 | } |
| 357 | } |
| 358 | } |
| 359 | return false |
| 360 | } |
| 361 | |
| 362 | func isNumericEncodingTypeID(typeID TypeId) bool { |
| 363 | switch typeID { |
no test coverage detected