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

Function hashValidation

http/codegen/openapi/v3/types.go:473–491  ·  view source on GitHub ↗
(val *expr.ValidationExpr, h hash.Hash64)

Source from the content-addressed store, hash-verified

471}
472
473func hashValidation(val *expr.ValidationExpr, h hash.Hash64) uint64 {
474 // Note: we can't use hashstructure for attributes because it doesn't
475 // handle recursive structures.
476 if val == nil {
477 return 0
478 }
479
480 res, err := hashstructure.Hash(val, &hashstructure.HashOptions{
481 Hasher: h,
482 ZeroNil: false,
483 IgnoreZeroValue: true,
484 SlicesAsSets: true,
485 })
486 if err != nil {
487 // should really never happen (OOM maybe)
488 return 0
489 }
490 return res
491}
492
493func hashString(s string, h hash.Hash64) uint64 {
494 h.Reset()

Callers 1

hashAttributeFunction · 0.85

Calls 1

HashMethod · 0.65

Tested by

no test coverage detected