summaryrefslogtreecommitdiff
path: root/doc/go1.1.html
diff options
context:
space:
mode:
authorAndrew Gerrand <adg@golang.org>2013-04-08 11:41:01 +1000
committerAndrew Gerrand <adg@golang.org>2013-04-08 11:41:01 +1000
commit95ec012e9b3da166cdbc740b67701ddaaf5a58aa (patch)
treef3513cbc15b260b58904fdb51999cee62c2f28b8 /doc/go1.1.html
parent81716b34bf460b7c383d80d5b74dfeb8ca2901f4 (diff)
downloadgo-95ec012e9b3da166cdbc740b67701ddaaf5a58aa.tar.gz
doc: document go1.1 build tag
Fixes issue 5235. R=golang-dev, r CC=golang-dev https://codereview.appspot.com/8426048
Diffstat (limited to 'doc/go1.1.html')
-rw-r--r--doc/go1.1.html25
1 files changed, 25 insertions, 0 deletions
diff --git a/doc/go1.1.html b/doc/go1.1.html
index fac922910..1332be21c 100644
--- a/doc/go1.1.html
+++ b/doc/go1.1.html
@@ -403,6 +403,31 @@ command now returns an error if test files are provided on the command line. In
this sense, "<code>go run</code>" replaces "<code>go run *.go</code>".
</p>
+<h3 id="tags">Build constraints</h3>
+
+<p>
+The <code>"go1.1</code>" tag has been added to the list of default
+<a href="/pkg/go/build/#hdr-Build_Constraints">build constraints</a>.
+This permits packages to take advanage of the new features in Go 1.1 while
+remaining compatible with earlier versions of Go.
+</p>
+
+<p>
+To build a file only with Go 1.1 and above, add this build constraint:
+</p>
+
+<pre>
+// +build go1.1
+</pre>
+
+<p>
+To build a file only with Go 1.0.x, use the converse constraint:
+</p>
+
+<pre>
+// +build !go1.1
+</pre>
+
<h3 id="platforms">Additional platforms</h3>
<p>