From 572ed6eeedd19ff61910e08de1f11f9b185b7545 Mon Sep 17 00:00:00 2001 From: smart Date: Thu, 21 Jan 2016 17:00:02 +0800 Subject: [PATCH] fix 10.6.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改语法错误 --- eBook/10.6.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eBook/10.6.md b/eBook/10.6.md index 18f300e..92275fc 100644 --- a/eBook/10.6.md +++ b/eBook/10.6.md @@ -238,9 +238,9 @@ func main() { 我们知道方法将指针作为接收者不是必须的,如下面的例子,我们只是需要 `Point3` 的值来做计算: ```go -type Point3 struct { x, y, z float } +type Point3 struct { x, y, z float64 } // A method on Point3 -func (p Point3) Abs float { +func (p Point3) Abs() float64 { return math.Sqrt(p.x*p.x + p.y*p.y + p.z*p.z) } ```