Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Hashcode ¶
Hashcode returns a hashcode of v Hashcode traverses the value v recursively. If an encountered value implements Hashcoder and is not a nil pointer, Hashcode calls [Hashcoder.Hashcode] to compute the hashcode of the value. Otherwise, Hashcode uses the default hashcode algorithm.
Example ¶
package main import ( "fmt" "github.com/okhomin/gohashcode" ) func main() { type S struct { A int B string C string `hash:"-"` // ignore E string `hash:"false"` // ignore F []uint G map[string]uint } hash := gohashcode.Hashcode(S{ A: 123, B: "Hello", C: "Ignore", E: "Ignore", F: []uint{1, 2, 3}, G: map[string]uint{ "one": 1, "two": 2, }, }) fmt.Println(hash) }
Types ¶
Click to show internal directories.
Click to hide internal directories.