IsCompatible returns true if o describes the (Go) type of val.
(val any)
| 531 | |
| 532 | // IsCompatible returns true if o describes the (Go) type of val. |
| 533 | func (*Object) IsCompatible(val any) bool { |
| 534 | k := reflect.TypeOf(val).Kind() |
| 535 | return k == reflect.Map || k == reflect.Struct |
| 536 | } |
| 537 | |
| 538 | // Example returns a random value of the object. |
| 539 | func (o *Object) Example(r *ExampleGenerator) any { |