summaryrefslogtreecommitdiffhomepage
path: root/go.html.markdown
diff options
context:
space:
mode:
authorgondo <gondo@webdesigners.sk>2017-07-02 20:38:55 +0800
committerven <vendethiel@hotmail.fr>2017-07-02 14:38:55 +0200
commit801484a23b3a65b7813929a390684b9f965729eb (patch)
treee3addb13bf271ed275fee190dd2db32a324f493c /go.html.markdown
parente78e41ce3038b23288ced37e81c019074ad60db4 (diff)
more clear explanation for interface (#2779)
more clear explanation why interface is consider defined without specifically declaring it (like in other languages `pair implement Stringer`)
Diffstat (limited to 'go.html.markdown')
-rw-r--r--go.html.markdown2
1 files changed, 1 insertions, 1 deletions
diff --git a/go.html.markdown b/go.html.markdown
index f097caeb..1e121b0f 100644
--- a/go.html.markdown
+++ b/go.html.markdown
@@ -295,7 +295,7 @@ type pair struct {
x, y int
}
-// Define a method on type pair. Pair now implements Stringer.
+// Define a method on type pair. Pair now implements Stringer because Pair has defined all the methods in the interface.
func (p pair) String() string { // p is called the "receiver"
// Sprintf is another public function in package fmt.
// Dot syntax references fields of p.