(union Union, visitorType reflect.Type)
| 55 | } |
| 56 | |
| 57 | func normalizeUnion(union Union, visitorType reflect.Type) error { |
| 58 | err := updateDiscriminator(union, visitorType) |
| 59 | if err != nil { |
| 60 | return err |
| 61 | } |
| 62 | |
| 63 | err = cleanupValues(union, visitorType) |
| 64 | if err != nil { |
| 65 | return err |
| 66 | } |
| 67 | return nil |
| 68 | } |
| 69 | |
| 70 | func updateDiscriminator(union Union, visitorType reflect.Type) error { |
| 71 | unionValue := reflect.ValueOf(union) |