Reviewers: golang-dev1,
Message:
Hello
golan...@googlegroups.com,
I'd like you to review this change to
https://code.google.com/p/go/
Description:
doc/faq: add a FAQ about versioning
Fixes issue 5633.
Please review this at
https://codereview.appspot.com/14283044/
Affected files (+39, -0 lines):
M doc/go_faq.html
Index: doc/go_faq.html
===================================================================
--- a/doc/go_faq.html
+++ b/doc/go_faq.html
@@ -1029,6 +1029,45 @@
</li>
</ul>
+<h3 id="get_version">
+How should I manage package versions using "go get"?</h3>
+
+<p>
+"Go get" does not have any explicit concept of package versions.
+Versioning is a source of significant complexity, especially in large code
bases,
+and we are unaware of any approach that works well at scale in a large
enough
+variety of situations to be appropriate to force on all Go users.
+What "go get" and the larger Go toolchain do provide is isolation of
+packages with different import paths.
+For example, the standard library's <code>html/template</code> and
<code>text/template</code>
+coexist even though both are "package template".
+This observation leads to some advice for package authors and package
users.
+</p>
+
+<p>
+As a package author, you should strive to keep the package API backwards
compatible,
+so that someone using today's copy of the package will be able to use
tomorrow's.
+This means, at minimum, not removing exported constants, types, variables,
and functions;
+not changing the type of exported constants, variables, and functions;
+not removing exported fields from exported struct types;
+and not adding or removing exported methods from exported interface types.
+If different functionality is required, add a new name instead of changing
an old one.
+If a complete break with the past is required, create a new package with a
new import path.
+</p>
+
+<p>
+As a package user, perhaps you cannot trust that the package author will
maintain
+backwards compatibility of the API, or perhaps you worry that future
implementation
+tradeoffs might hurt the performance of the package as used in your
application.
+The cleanest solution to this general problem is to make a copy of the
package
+as you want to use it, only updating to a new copy after you have been able
+to run correctness and performance tests ensuring that it still works well
for you.
+It usually works well to record that code under a new import path, making
clear that
+it is a local copy; for example, you might copy "
original.com/pkg"
to "
you.com/external/original.com/pkg".
+We have not yet added an official tool for this to the standard toolchain,
but users
+have written a few; Keith Rarick's <a
href="
https://github.com/kr/goven">goven</a> is one example.
+</p>
+
<h2 id="Pointers">Pointers and Allocation</h2>
<h3 id="pass_by_value">