doc/go1.16: document go/build/constraint package

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>
This commit is contained in:
Ian Lance Taylor 2021-01-27 13:54:10 -08:00
parent 376518d77f
commit 4b068cafb5

View 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 -->