From 6c7acdfbdbfd5c8a3b60d6b796041257360a19c3 Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Tue, 21 Jul 2015 14:05:13 +1000 Subject: [PATCH] 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 Reviewed-by: Russ Cox --- doc/go1compat.html | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/doc/go1compat.html b/doc/go1compat.html index d800dec0c0d..607d3546876 100644 --- a/doc/go1compat.html +++ b/doc/go1compat.html @@ -95,6 +95,18 @@ We therefore recommend that composite literals whose type is defined in a separate package should use the keyed notation. +
  • +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. +
  • +
  • Dot imports. If a program imports a standard package using import . "path", additional names defined in the