IsCompatible returns true if u describes the (Go) type of val.
(val any)
| 639 | |
| 640 | // IsCompatible returns true if u describes the (Go) type of val. |
| 641 | func (u *Union) IsCompatible(val any) bool { |
| 642 | for _, nat := range u.Values { |
| 643 | if nat.Attribute.Type.IsCompatible(val) { |
| 644 | return true |
| 645 | } |
| 646 | } |
| 647 | return false |
| 648 | } |
| 649 | |
| 650 | // Example returns a random example value. |
| 651 | func (u *Union) Example(r *ExampleGenerator) any { |
nothing calls this directly
no test coverage detected