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

Function Hash

expr/hasher.go:32–34  ·  view source on GitHub ↗

Hash returns a hash value for the given data type. Two types have the same hash if: - both types have the same kind - array types have elements whose types have the same hash - map types have keys and elements whose types have the same hash - user types have the same name if ignoreNames is false or

(dt DataType, ignoreFields, ignoreNames, ignoreTags bool)

Source from the content-addressed store, hash-verified

30// - user types have the same attribute names and the attribute types have the same hash if ignoreFields is false
31// - object attributes have the same "struct:field:xxx" tags if ignoreTags is false
32func Hash(dt DataType, ignoreFields, ignoreNames, ignoreTags bool) string {
33 return *hash(dt, ignoreFields, ignoreNames, ignoreTags, make(map[*Object]*string))
34}
35
36func hash(dt DataType, ignoreFields, ignoreNames, ignoreTags bool, seen map[*Object]*string) *string {
37 if seen == nil {

Callers 10

TestPrimitiveHashFunction · 0.85
TestObjectHashFunction · 0.85
HashMethod · 0.85
EqualFunction · 0.85
HashMethod · 0.85
HashMethod · 0.85
HashMethod · 0.85
HashMethod · 0.85
hashAttrAndViewFunction · 0.85
TestProjectFunction · 0.85

Calls 1

hashFunction · 0.85

Tested by 3

TestPrimitiveHashFunction · 0.68
TestObjectHashFunction · 0.68
TestProjectFunction · 0.68