From e6498dcf9f6eaa609019691d6ab5a438f7e5e4b0 Mon Sep 17 00:00:00 2001 From: orangleliu Date: Mon, 17 Sep 2018 16:36:36 +0800 Subject: [PATCH] =?UTF-8?q?fix=20ch5-09=20=E7=AB=A0=E8=8A=82=E7=A4=BA?= =?UTF-8?q?=E4=BE=8B=E4=BB=A3=E7=A0=81=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复ch5-09最后一段示例代码中,代码函数名称以及变量类型导致代码运行不通过的错误 --- ch5-web/ch5-09-gated-launch.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ch5-web/ch5-09-gated-launch.md b/ch5-web/ch5-09-gated-launch.md index bfab748..1e6c737 100644 --- a/ch5-web/ch5-09-gated-launch.md +++ b/ch5-web/ch5-09-gated-launch.md @@ -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)) } ```