From 61b5c866a9507524d0a3d7a7e0c892c975ca081b Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Fri, 18 Feb 2022 14:51:58 -0500 Subject: [PATCH] doc/go1.18: document Go 1.17 bootstrap and //go:build fix For #44505 and #41184. Change-Id: I9503292dace1aa60de167ca5807bf131554465b9 Reviewed-on: https://go-review.googlesource.com/c/go/+/386774 Trust: Russ Cox Run-TryBot: Russ Cox Reviewed-by: Jeremy Faller --- doc/go1.18.html | 50 ++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 45 insertions(+), 5 deletions(-) diff --git a/doc/go1.18.html b/doc/go1.18.html index c75bfe9e5dd17f..ce4030799a172e 100644 --- a/doc/go1.18.html +++ b/doc/go1.18.html @@ -250,6 +250,8 @@

Fuzzing

Go command

+

go get

+

go get no longer builds or installs packages in module-aware mode. go get is now dedicated to @@ -269,6 +271,8 @@

Go command

and installs packages, as before.

+

go version

+

The go command now embeds version control information in binaries including the currently checked-out revision, commit time, and a @@ -303,6 +307,8 @@

Go command

debug/buildinfo package from go 1.18+.

+

go mod download

+

If the main module's go.mod file specifies go 1.17 @@ -316,6 +322,8 @@

Go command

go mod download all.

+

go mod vendor

+

The go mod vendor subcommand now supports a -o flag to set the output directory. @@ -325,6 +333,8 @@

Go command

third-party tools that need to collect package source code.)

+

go build -asan

+

The go build command and related commands now support an -asan flag that enables interoperation @@ -332,6 +342,8 @@

Go command

option -fsanitize=address).

+

go mod tidy

+

The go mod tidy command now retains additional checksums in the go.sum file for modules whose source @@ -342,6 +354,8 @@

Go command

module's go.mod file.

+

go work

+

The go command now supports a "Workspace" mode. If a go.work file is found in the working directory or a @@ -355,6 +369,8 @@

Go command

documentation.

+

go test

+

The go command now supports additional command line options for the new fuzzing support described @@ -376,11 +392,28 @@

Go command

+

//go:build lines

+

- TODO: https://golang.org/cl/240611: 240611: cmd/fix: add buildtag fix +Go 1.17 introduced //go:build lines as a more readable way to write build constraints, +instead of // +build lines. +As of Go 1.17, gofmt adds //go:build lines +to match existing +build lines and keeps them in sync, +while go vet diagnoses when they are out of sync. +

+ +

Since the release of Go 1.18 marks the end of support for Go 1.16, +all supported versions of Go now understand //go:build lines. +In Go 1.18, go fix now removes the now-obsolete +// +build lines in modules declaring +go 1.17 or later in their go.mod files. +

+ +

+For more information, see https://go.dev/design/draft-gobuild.

-

gofmt

+

Gofmt

gofmt now reads and formats input files concurrently, with a @@ -388,7 +421,7 @@

gofmt

multiple CPUs, gofmt should now be significantly faster.

-

vet

+

Vet

Updates for Generics

@@ -510,10 +543,17 @@

Linker

new go command -asan option.

-

Build

+

Bootstrap

- TODO: https://golang.org/cl/369914: for default bootstrap, use Go 1.17 if present, falling back to Go 1.4 +When building a Go release from source and GOROOT_BOOTSTRAP +is not set, previous versions of Go looked for a Go 1.4 or later bootstrap toolchain +in the directory $HOME/go1.4 (%HOMEDRIVE%%HOMEPATH%\go1.4 on Windows). +Go now looks first for $HOME/go1.17 or $HOME/sdk/go1.17 +before falling back to $HOME/go1.4. +We intend for Go 1.19 to require Go 1.17 or later for bootstrap, +and this change should make the transition smoother. +For more details, see go.dev/issue/44505.

Core library