mirror of
https://github.com/golang/go
synced 2024-09-05 07:54:46 +00:00
doc: add a clause about embedded methods to go1compat
This is a corner case but it is suggested we call it out. Fixes #11798. Change-Id: I2ddb5b363cd2921666dbf03bbf98107697ca40e5 Reviewed-on: https://go-review.googlesource.com/12460 Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
This commit is contained in:
parent
fc7f6d307a
commit
6c7acdfbdb
|
@ -95,6 +95,18 @@ We therefore recommend that composite literals whose type is defined
|
|||
in a separate package should use the keyed notation.
|
||||
</li>
|
||||
|
||||
<li>
|
||||
Methods. As with struct fields, it may be necessary to add methods
|
||||
to types.
|
||||
Under some circumstances, such as when the type is embedded in
|
||||
a struct along with another type,
|
||||
the addition of the new method may break
|
||||
the struct by creating a conflict with an existing method of the other
|
||||
embedded type.
|
||||
We cannot protect against this rare case and do not guarantee compatibility
|
||||
should it arise.
|
||||
</li>
|
||||
|
||||
<li>
|
||||
Dot imports. If a program imports a standard package
|
||||
using <code>import . "path"</code>, additional names defined in the
|
||||
|
|
Loading…
Reference in a new issue