From 78c4d50d250215cd99f8e56525a8c9cc0c092f63 Mon Sep 17 00:00:00 2001 From: Andrew Gerrand Date: Mon, 8 Apr 2013 11:41:01 +1000 Subject: [PATCH] doc: document go1.1 build tag Fixes #5235. R=golang-dev, r CC=golang-dev https://golang.org/cl/8426048 --- doc/go1.1.html | 25 +++++++++++++++++++++++++ src/pkg/go/build/doc.go | 3 ++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/doc/go1.1.html b/doc/go1.1.html index fac922910a..1332be21ce 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, "go run" replaces "go run *.go".

+

Build constraints

+ +

+The "go1.1" tag has been added to the list of default +build constraints. +This permits packages to take advanage of the new features in Go 1.1 while +remaining compatible with earlier versions of Go. +

+ +

+To build a file only with Go 1.1 and above, add this build constraint: +

+ +
+// +build go1.1
+
+ +

+To build a file only with Go 1.0.x, use the converse constraint: +

+ +
+// +build !go1.1
+
+

Additional platforms

diff --git a/src/pkg/go/build/doc.go b/src/pkg/go/build/doc.go index c562d05d00..4b66b84bb6 100644 --- a/src/pkg/go/build/doc.go +++ b/src/pkg/go/build/doc.go @@ -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, -- 2.50.0