mirror of
https://github.com/golang/go
synced 2024-11-25 08:47:56 -07:00
doc: document go1.1 build tag
Fixes #5235. R=golang-dev, r CC=golang-dev https://golang.org/cl/8426048
This commit is contained in:
parent
b6bfc92df3
commit
78c4d50d25
@ -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>
|
||||
|
@ -91,8 +91,9 @@
|
||||
//
|
||||
// - the target operating system, as spelled by runtime.GOOS
|
||||
// - the target architecture, as spelled by runtime.GOARCH
|
||||
// - the compiler being used, currently either "gc" or "gccgo"
|
||||
// - the compiler being used, either "gc" or "gccgo"
|
||||
// - "cgo", if ctxt.CgoEnabled is true
|
||||
// - "go1.1", from Go version 1.1 onward
|
||||
// - any additional words listed in ctxt.BuildTags
|
||||
//
|
||||
// If a file's name, after stripping the extension and a possible _test suffix,
|
||||
|
Loading…
Reference in New Issue
Block a user