Skip to content

Commit

Permalink
all: go fmt std cmd (but revert vendor)
Browse files Browse the repository at this point in the history
Make all our package sources use Go 1.17 gofmt format
(adding //go:build lines).

Part of //go:build change (#41184).
See https://golang.org/design/draft-gobuild

Change-Id: Ia0534360e4957e58cd9a18429c39d0e32a6addb4
Reviewed-on: https://go-review.googlesource.com/c/go/+/294430
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
  • Loading branch information
rsc committed Feb 20, 2021
1 parent 0625460 commit d4b2638
Show file tree
Hide file tree
Showing 826 changed files with 883 additions and 106 deletions.
1 change: 1 addition & 0 deletions src/archive/tar/stat_actime1.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build aix || linux || dragonfly || openbsd || solaris
// +build aix linux dragonfly openbsd solaris

package tar
Expand Down
1 change: 1 addition & 0 deletions src/archive/tar/stat_actime2.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build darwin || freebsd || netbsd
// +build darwin freebsd netbsd

package tar
Expand Down
1 change: 1 addition & 0 deletions src/archive/tar/stat_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build aix || linux || darwin || dragonfly || freebsd || openbsd || netbsd || solaris
// +build aix linux darwin dragonfly freebsd openbsd netbsd solaris

package tar
Expand Down
1 change: 1 addition & 0 deletions src/bytes/boundary_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
//go:build linux
// +build linux

package bytes_test
Expand Down
1 change: 1 addition & 0 deletions src/cmd/api/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build ignore
// +build ignore

// The run program is invoked via the dist tool.
Expand Down
1 change: 1 addition & 0 deletions src/cmd/compile/internal/gc/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build !go1.8
// +build !go1.8

package gc
Expand Down
1 change: 1 addition & 0 deletions src/cmd/compile/internal/gc/pprof.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build go1.8
// +build go1.8

package gc
Expand Down
1 change: 1 addition & 0 deletions src/cmd/compile/internal/gc/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build go1.7
// +build go1.7

package gc
Expand Down
1 change: 1 addition & 0 deletions src/cmd/compile/internal/ir/mknode.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build ignore
// +build ignore

package main
Expand Down
1 change: 1 addition & 0 deletions src/cmd/compile/internal/logopt/escape.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build go1.8
// +build go1.8

package logopt
Expand Down
1 change: 1 addition & 0 deletions src/cmd/compile/internal/logopt/escape_bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build !go1.8
// +build !go1.8

package logopt
Expand Down
1 change: 1 addition & 0 deletions src/cmd/compile/internal/ssa/flags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build amd64 || arm64
// +build amd64 arm64

package ssa
Expand Down
1 change: 1 addition & 0 deletions src/cmd/compile/internal/typecheck/mapfile_mmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd
// +build darwin dragonfly freebsd linux netbsd openbsd

package typecheck
Expand Down
1 change: 1 addition & 0 deletions src/cmd/compile/internal/typecheck/mapfile_read.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd
// +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd

package typecheck
Expand Down
1 change: 1 addition & 0 deletions src/cmd/compile/internal/typecheck/mkbuiltin.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build ignore
// +build ignore

// Generate builtin.go from builtin/runtime.go.
Expand Down
1 change: 1 addition & 0 deletions src/cmd/compile/internal/types2/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// Only run where builders (build.golang.org) have
// access to compiled packages for import.
//
//go:build !arm && !arm64
// +build !arm,!arm64

package types2_test
Expand Down
1 change: 1 addition & 0 deletions src/cmd/dist/sys_default.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build !windows
// +build !windows

package main
Expand Down
1 change: 1 addition & 0 deletions src/cmd/dist/test_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build linux
// +build linux

package main
Expand Down
1 change: 1 addition & 0 deletions src/cmd/dist/util_gc.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build !gccgo
// +build !gccgo

package main
Expand Down
1 change: 1 addition & 0 deletions src/cmd/dist/util_gccgo.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build gccgo
// +build gccgo

package main
Expand Down
1 change: 1 addition & 0 deletions src/cmd/go/go11.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build go1.1
// +build go1.1

package main
Expand Down
1 change: 1 addition & 0 deletions src/cmd/go/go_unix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
// +build darwin dragonfly freebsd linux netbsd openbsd solaris

package main_test
Expand Down
1 change: 1 addition & 0 deletions src/cmd/go/internal/base/signal_notunix.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build plan9 || windows
// +build plan9 windows

package base
Expand Down
1 change: 1 addition & 0 deletions src/cmd/go/internal/base/signal_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build aix || darwin || dragonfly || freebsd || js || linux || netbsd || openbsd || solaris
// +build aix darwin dragonfly freebsd js linux netbsd openbsd solaris

package base
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build aix || (solaris && !illumos)
// +build aix solaris,!illumos

// This code implements the filelock API using POSIX 'fcntl' locks, which attach
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !plan9 && !solaris && !windows
// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!plan9,!solaris,!windows

package filelock
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build plan9
// +build plan9

package filelock
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build !js && !plan9
// +build !js,!plan9

package filelock_test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build darwin || dragonfly || freebsd || illumos || linux || netbsd || openbsd
// +build darwin dragonfly freebsd illumos linux netbsd openbsd

package filelock
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build windows
// +build windows

package filelock
Expand Down
1 change: 1 addition & 0 deletions src/cmd/go/internal/lockedfile/lockedfile_filelock.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build !plan9
// +build !plan9

package lockedfile
Expand Down
1 change: 1 addition & 0 deletions src/cmd/go/internal/lockedfile/lockedfile_plan9.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build plan9
// +build plan9

package lockedfile
Expand Down
1 change: 1 addition & 0 deletions src/cmd/go/internal/lockedfile/lockedfile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// license that can be found in the LICENSE file.

// js does not support inter-process file locking.
//go:build !js
// +build !js

package lockedfile_test
Expand Down
1 change: 1 addition & 0 deletions src/cmd/go/internal/lockedfile/transform_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// license that can be found in the LICENSE file.

// js does not support inter-process file locking.
//go:build !js
// +build !js

package lockedfile_test
Expand Down
1 change: 1 addition & 0 deletions src/cmd/go/internal/modfetch/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build cmd_go_bootstrap
// +build cmd_go_bootstrap

package modfetch
Expand Down
1 change: 1 addition & 0 deletions src/cmd/go/internal/modfetch/codehost/shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build ignore
// +build ignore

// Interactive debugging shell for codehost.Repo implementations.
Expand Down
1 change: 1 addition & 0 deletions src/cmd/go/internal/modfetch/sumdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

// Go checksum database lookup

//go:build !cmd_go_bootstrap
// +build !cmd_go_bootstrap

package modfetch
Expand Down
1 change: 1 addition & 0 deletions src/cmd/go/internal/modload/stat_openfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build (js && wasm) || plan9
// +build js,wasm plan9

// On plan9, per http://9p.io/magic/man2html/2/access: “Since file permissions
Expand Down
1 change: 1 addition & 0 deletions src/cmd/go/internal/modload/stat_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris

package modload
Expand Down
1 change: 1 addition & 0 deletions src/cmd/go/internal/modload/stat_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build windows
// +build windows

package modload
Expand Down
1 change: 1 addition & 0 deletions src/cmd/go/internal/renameio/renameio_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build !plan9
// +build !plan9

package renameio
Expand Down
1 change: 1 addition & 0 deletions src/cmd/go/internal/renameio/umask_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build !plan9 && !windows && !js
// +build !plan9,!windows,!js

package renameio
Expand Down
1 change: 1 addition & 0 deletions src/cmd/go/internal/robustio/robustio_flaky.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build windows || darwin
// +build windows darwin

package robustio
Expand Down
1 change: 1 addition & 0 deletions src/cmd/go/internal/robustio/robustio_other.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build !windows && !darwin
// +build !windows,!darwin

package robustio
Expand Down
1 change: 1 addition & 0 deletions src/cmd/go/internal/test/genflags.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build ignore
// +build ignore

package main
Expand Down
1 change: 1 addition & 0 deletions src/cmd/go/internal/web/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build cmd_go_bootstrap
// +build cmd_go_bootstrap

// This code is compiled only into the bootstrap 'go' binary.
Expand Down
1 change: 1 addition & 0 deletions src/cmd/go/internal/web/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build !cmd_go_bootstrap
// +build !cmd_go_bootstrap

// This code is compiled into the real 'go' binary, but it is not
Expand Down
1 change: 1 addition & 0 deletions src/cmd/go/internal/web/url_other.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build !windows
// +build !windows

package web
Expand Down
1 change: 1 addition & 0 deletions src/cmd/go/internal/web/url_other_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build !windows
// +build !windows

package web
Expand Down
1 change: 1 addition & 0 deletions src/cmd/go/internal/work/testgo.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

// This file contains extra hooks for testing the go command.

//go:build testgo
// +build testgo

package work
Expand Down
Loading

0 comments on commit d4b2638

Please sign in to comment.