]> Cypherpunks repositories - gostls13.git/commit
doc: improve the interface example in Effective Go
authorRob Pike <r@golang.org>
Mon, 26 Nov 2018 03:51:08 +0000 (14:51 +1100)
committerRob Pike <r@golang.org>
Mon, 26 Nov 2018 05:08:25 +0000 (05:08 +0000)
commitcf2054088099ca90535f2baf6af02bb495a7439c
tree891dc2084c868f132ed63b01c66f269055c867cb
parent048c9164a0c5572df18325e377473e7893dbfb07
doc: improve the interface example in Effective Go

The String method is n-squared and overwrites its receiver.
Fix both issues, with only a slight loss of clarity.

Fixes #28773

Change-Id: I588f69d4cbd72931b28b984671512834473bd466
Reviewed-on: https://go-review.googlesource.com/c/151217
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
doc/effective_go.html
doc/progs/eff_sequence.go