зеркало из https://github.com/CryptoPro/go.git
fix pre-submit editing typo; text is garbled.
R=rsc DELTA=2 (0 added, 0 deleted, 2 changed) OCL=35841 CL=35841
This commit is contained in:
Родитель
8840726edc
Коммит
c58d9efc63
|
@ -1771,8 +1771,8 @@ it also satisfies all three interfaces:
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
There's one important way in which embedding differs from subclassing. When we embed a type,
|
There's one important way in which embedding differs from subclassing. When we embed a type,
|
||||||
the methods of that type become methods of the out type
|
the methods of that type become methods of the outer type,
|
||||||
<but when they are invoked the receiver of the method is the inner type, not the outer one.
|
but when they are invoked the receiver of the method is the inner type, not the outer one.
|
||||||
In our example, when the <code>Read</code> method of a <code>bufio.ReadWriter</code> is
|
In our example, when the <code>Read</code> method of a <code>bufio.ReadWriter</code> is
|
||||||
invoked, it has the exactly the same effect as the forwarding method written out above;
|
invoked, it has the exactly the same effect as the forwarding method written out above;
|
||||||
the receiver is the <code>reader</code> field of the <code>ReadWriter</code>, not the
|
the receiver is the <code>reader</code> field of the <code>ReadWriter</code>, not the
|
||||||
|
|
Загрузка…
Ссылка в новой задаче