Skip to content

Commit b369640

Browse files
committed
all: fmt tests with new gofmt
Part of //go:build change (#41184). See https://golang.org/design/draft-gobuild The Go 1.17 gofmt will insert the extra //go:build lines. The older gofmts will not remove them. Get ahead of the game by adding them now. (Keeps x/tools tests passing on go repo trybots.) Change-Id: Ifdb4af93f6cc38a9aa616516e923384b7312e991 Reviewed-on: https://go-review.googlesource.com/c/tools/+/294413 gopls-CI: kokoro <[email protected]> Reviewed-by: Robert Griesemer <[email protected]> Trust: Robert Griesemer <[email protected]> Trust: Russ Cox <[email protected]> TryBot-Result: Go Bot <[email protected]> Run-TryBot: Russ Cox <[email protected]>
1 parent f6e0443 commit b369640

32 files changed

+9
-55
lines changed

cmd/bundle/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ func bundle(src, dst, dstpkg, prefix, buildTags string) ([]byte, error) {
228228

229229
var out bytes.Buffer
230230
if buildTags != "" {
231+
fmt.Fprintf(&out, "//go:build %s\n", buildTags)
231232
fmt.Fprintf(&out, "// +build %s\n\n", buildTags)
232233
}
233234

cmd/bundle/testdata/out.golden

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build tag
12
// +build tag
23

34
// Code generated by golang.org/x/tools/cmd/bundle. DO NOT EDIT.

internal/lsp/command/command_gen.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/lsp/command/gen/gen.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/lsp/command/generate.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build ignore
56
// +build ignore
67

78
package main
@@ -11,11 +12,11 @@ import (
1112
"io/ioutil"
1213
"os"
1314

14-
"golang.org/x/tools/internal/lsp/command/generate"
15+
"golang.org/x/tools/internal/lsp/command/gen"
1516
)
1617

1718
func main() {
18-
content, err := generate.Generate()
19+
content, err := gen.Generate()
1920
if err != nil {
2021
fmt.Fprintf(os.Stderr, "%v\n", err)
2122
os.Exit(1)

refactor/eg/testdata/A.template

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// +build ignore
2-
31
package template
42

53
// Basic test of type-aware expression refactoring.

refactor/eg/testdata/A1.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// +build ignore
2-
31
package A1
42

53
import (

refactor/eg/testdata/A1.golden

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// +build ignore
2-
31
package A1
42

53
import (

refactor/eg/testdata/A2.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// +build ignore
2-
31
package A2
42

53
// This refactoring causes addition of "errors" import.

refactor/eg/testdata/A2.golden

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// +build ignore
2-
31
package A2
42

53
// This refactoring causes addition of "errors" import.

0 commit comments

Comments
 (0)