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

Function Equal

expr/types.go:288–290  ·  view source on GitHub ↗

Equal compares the types recursively and returns true if they are equal. Two types are equal if: - both types have the same kind - array types have elements whose types are equal - map types have keys and elements whose types are equal - objects have the same attribute names and the attribute types

(dt, dt2 DataType)

Source from the content-addressed store, hash-verified

286// as the former may return true for two user types with different names and
287// thus with different hash values.
288func Equal(dt, dt2 DataType) bool {
289 return Hash(dt, false, true, true) == Hash(dt2, false, true, true)
290}
291
292// DataType implementation
293

Callers 7

InitStructFieldsFunction · 0.92
compatibleFunction · 0.92
TestAsObjectFunction · 0.85
TestAsArrayFunction · 0.85
TestAsMapFunction · 0.85
TestEqualFunction · 0.85
TestProjectFunction · 0.85

Calls 1

HashFunction · 0.85

Tested by 5

TestAsObjectFunction · 0.68
TestAsArrayFunction · 0.68
TestAsMapFunction · 0.68
TestEqualFunction · 0.68
TestProjectFunction · 0.68