Merge pull request #17961 from hashicorp/f-HashInt
Add a HashInt helper/schema function
This commit is contained in:
commit
b95f74956a
|
@ -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