]> Cypherpunks repositories - gostls13.git/commitdiff
doc/go1.16: document go/build/constraint package
authorIan Lance Taylor <iant@golang.org>
Wed, 27 Jan 2021 21:54:10 +0000 (13:54 -0800)
committerIan Lance Taylor <iant@golang.org>
Thu, 28 Jan 2021 05:46:54 +0000 (05:46 +0000)
For #40700
For #41184
Fixes #43957

Change-Id: Ia346f4cf160431b721efeba7dc5f1fb8814efd95
Reviewed-on: https://go-review.googlesource.com/c/go/+/287472
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
doc/go1.16.html

index 3a45940479d25244101a5ba7c67f987409b0ddf8..6cc75b4865429a25afebb3e556e9d1e548d6db95 100644 (file)
@@ -762,6 +762,25 @@ func TestFoo(t *testing.T) {
   </dd>
 </dl><!-- go/build -->
 
+<dl id="go/build/constraint"><dt><a href="/pkg/go/build/constraint/">go/build/constraint</a></dt>
+  <dd>
+    <p><!-- CL 240604 -->
+      The new
+      <a href="/pkg/go/build/constraint/"><code>go/build/constraint</code></a>
+      package parses build constraint lines, both the original
+      <code>// +build</code> syntax and the <code>//go:build</code>
+      syntax that will be introduced in Go 1.17.
+      This package exists so that tools built with Go 1.16 will be able
+      to process Go 1.17 source code.
+      See <a href="https://golang.org/design/draft-gobuild">https://golang.org/design/draft-gobuild</a>
+      for details about the build constraint syntaxes and the planned
+      transition to the <code>//go:build</code> syntax.
+      Note that <code>//go:build</code> lines are <b>not</b> supported
+      in Go 1.16 and should not be introduced into Go programs yet.
+    </p>
+  </dd>
+</dl><!-- go/build/constraint -->
+
 <dl id="html/template"><dt><a href="/pkg/html/template/">html/template</a></dt>
   <dd>
     <p><!-- CL 243938 -->