aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrung Nguyen <trung.n.k@gmail.com>2017-04-18 22:20:30 +0800
committerChris Broadfoot <cbro@golang.org>2017-04-21 01:50:13 +0000
commit97f0ee8b016282b578395cd0dda1f9c3aabf81ec (patch)
tree890f9486a11442506f1503b3a17effcd4b1a86ef
parentcd978b761ea990975ef36825a6a1831b0c2f29c1 (diff)
downloadgolang-id-tour-97f0ee8b016282b578395cd0dda1f9c3aabf81ec.tar.xz
tour: method call not correct
Fixes golang/tour#202. Change-Id: Ibffa127f6bdbe9c2ce8d47f358d355795e214a2b Reviewed-on: https://go-review.googlesource.com/40897 Reviewed-by: Chris Broadfoot <cbro@golang.org>
-rw-r--r--content/methods.article8
1 files changed, 4 insertions, 4 deletions
diff --git a/content/methods.article b/content/methods.article
index bb40024..7475369 100644
--- a/content/methods.article
+++ b/content/methods.article
@@ -82,8 +82,8 @@ Comparing the previous two programs, you might notice that
functions with a pointer argument must take a pointer:
var v Vertex
- ScaleFunc(v) // Compile error!
- ScaleFunc(&v) // OK
+ ScaleFunc(v, 5) // Compile error!
+ ScaleFunc(&v, 5) // OK
while methods with pointer receivers take either a value or a pointer as the
receiver when they are called:
@@ -291,7 +291,7 @@ For instance, `IPAddr{1,`2,`3,`4}` should print as `"1.2.3.4"`.
* Errors
-Go programs express error state with `error` values.
+Go programs express error state with `error` values.
The `error` type is a built-in interface similar to `fmt.Stringer`:
@@ -353,7 +353,7 @@ The `io.Reader` interface has a `Read` method:
populated and an error value. It returns an `io.EOF` error when the stream
ends.
-The example code creates a
+The example code creates a
[[//golang.org/pkg/strings/#Reader][`strings.Reader`]]
and consumes its output 8 bytes at a time.