diff --git a/_demo/go/maphash/maphash.go b/_demo/go/maphash/maphash.go index 44524b04..93d80032 100644 --- a/_demo/go/maphash/maphash.go +++ b/_demo/go/maphash/maphash.go @@ -8,19 +8,16 @@ import ( func main() { var h maphash.Hash h.WriteString("hello") - fmt.Printf("0x%x\n", h.Sum64()) + hash1 := h.Sum64() + fmt.Printf("0x%x\n", hash1) h.Reset() h.WriteString("world") - fmt.Printf("0x%x\n", h.Sum64()) + hash2 := h.Sum64() + fmt.Printf("0x%x\n", hash2) h.Reset() - h.WriteString("test") - v1 := h.Sum64() - - h.Reset() - h.WriteString("test") - v2 := h.Sum64() - - fmt.Printf("0x%x == 0x%x\n", v1, v2) + h.WriteString("hello") + hash3 := h.Sum64() + fmt.Printf("0x%x == 0x%x\n", hash1, hash3) }