From 801484a23b3a65b7813929a390684b9f965729eb Mon Sep 17 00:00:00 2001 From: gondo Date: Sun, 2 Jul 2017 20:38:55 +0800 Subject: 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`) --- go.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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. -- cgit v1.2.3