Skip to content

Commit

Permalink
more clear explanation for interface (adambard#2779)
Browse files Browse the repository at this point in the history
more clear explanation why interface is consider defined without specifically declaring it (like in other languages `pair implement Stringer`)
  • Loading branch information
gondo authored and vendethiel committed Jul 2, 2017
1 parent e78e41c commit 801484a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion go.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 801484a

Please sign in to comment.