mirror of
https://github.com/golang/go
synced 2024-11-22 01:14:40 -07:00
There should not be a prohibition against embedding an
interface type in a struct. It is meaningful and the compilers support it. R=gri DELTA=2 (0 added, 0 deleted, 2 changed) OCL=33378 CL=33384
This commit is contained in:
parent
fb9490c2ec
commit
3e804ba7a7
@ -695,8 +695,8 @@ struct {
|
|||||||
A field declared with a type but no field identifier is an <i>anonymous field</i>.
|
A field declared with a type but no field identifier is an <i>anonymous field</i>.
|
||||||
Such a field type must be specified as
|
Such a field type must be specified as
|
||||||
a type name <code>T</code> or as a pointer to a type name <code>*T</code>,
|
a type name <code>T</code> or as a pointer to a type name <code>*T</code>,
|
||||||
and <code>T</code> itself, may not be
|
and <code>T</code> itself may not be
|
||||||
a pointer or interface type. The unqualified type name acts as the field identifier.
|
a pointer type. The unqualified type name acts as the field identifier.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
|
Loading…
Reference in New Issue
Block a user