Add a HashInt helper/schema function
This commit is contained in:
parent
c1bc0be7b2
commit
a182a53108
|
@ -17,6 +17,12 @@ func HashString(v interface{}) int {
|
||||||
return hashcode.String(v.(string))
|
return hashcode.String(v.(string))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// HashInt hashes integers. If you want a Set of integers, this is the
|
||||||
|
// SchemaSetFunc you want.
|
||||||
|
func HashInt(v interface{}) int {
|
||||||
|
return hashcode.String(strconv.Itoa(v.(int)))
|
||||||
|
}
|
||||||
|
|
||||||
// HashResource hashes complex structures that are described using
|
// HashResource hashes complex structures that are described using
|
||||||
// a *Resource. This is the default set implementation used when a set's
|
// a *Resource. This is the default set implementation used when a set's
|
||||||
// element type is a full resource.
|
// element type is a full resource.
|
||||||
|
|
Loading…
Reference in New Issue