1
0
mirror of https://github.com/chai2010/advanced-go-programming-book.git synced 2025-05-28 07:22:20 +00:00

Merge pull request #361 from orangle/patch-3

fix ch5-09 章节示例代码错误
This commit is contained in:
Xargin 2018-09-17 23:16:03 +08:00 committed by GitHub
commit 0a86470275
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -305,15 +305,15 @@ import (
var bucketSize = 10
func main() {
var bucketMap = map[uint32]int{}
var bucketMap = map[uint64]int{}
for i := 15000000000; i < 15000000000+10000000; i++ {
hashInt := murmur64(fmt.Sprint(i)) % bucketSize
hashInt := murmur64(fmt.Sprint(i)) % uint64(bucketSize)
bucketMap[hashInt]++
}
fmt.Println(bucketMap)
}
func murmur32(p string) uint64 {
func murmur64(p string) uint64 {
return murmur3.Sum64([]byte(p))
}
```