Commit 04a44d2
_content/doc/faq: clarify the explanation of method sets
I had a small discussion with @ianlancetaylor here:
https://groups.google.com/g/golang-nuts/c/uon32LDerjM/m/dvg0mxbwAAAJ?utm_medium=email&utm_source=footer
I would like to clarify this entry about method sets a bit because the current explanation is a bit confusing. I believe there is no reason for the Write method of Buffer to use a value receiver. In this case, the sentence about the compiler's ability to implicitly take addresses doesn't make sense.
What I believe is implied here is a hypothetical situation where the code from the example is allowed by Go, and then it is noted that this makes no sense as the result would be lost in the caller.
Change-Id: Ie4de77364165d59178e2b1e6e1393370e06d1755
GitHub-Last-Rev: 40392d4
GitHub-Pull-Request: #296
Reviewed-on: https://go-review.googlesource.com/c/website/+/601996
Auto-Submit: Ian Lance Taylor <[email protected]>
Reviewed-by: Rob Pike <[email protected]>
Reviewed-by: Ian Lance Taylor <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>1 parent d2408a1 commit 04a44d2
1 file changed
+4
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1425 | 1425 | | |
1426 | 1426 | | |
1427 | 1427 | | |
1428 | | - | |
1429 | | - | |
1430 | | - | |
1431 | | - | |
| 1428 | + | |
| 1429 | + | |
1432 | 1430 | | |
1433 | 1431 | | |
1434 | 1432 | | |
1435 | 1433 | | |
1436 | 1434 | | |
1437 | 1435 | | |
1438 | | - | |
| 1436 | + | |
1439 | 1437 | | |
1440 | | - | |
| 1438 | + | |
1441 | 1439 | | |
1442 | 1440 | | |
1443 | 1441 | | |
| |||
0 commit comments