MCPcopy Create free account
hub / github.com/goadesign/goa / IsCompatible

Method IsCompatible

expr/types.go:533–536  ·  view source on GitHub ↗

IsCompatible returns true if o describes the (Go) type of val.

(val any)

Source from the content-addressed store, hash-verified

531
532// IsCompatible returns true if o describes the (Go) type of val.
533func (*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.
539func (o *Object) Example(r *ExampleGenerator) any {

Callers 1

TestObjectIsCompatibleFunction · 0.95

Calls 1

KindMethod · 0.65

Tested by 1

TestObjectIsCompatibleFunction · 0.76