aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/gofmt
diff options
context:
space:
mode:
authorRob Findley <rfindley@google.com>2021-06-21 20:12:20 -0400
committerRobert Findley <rfindley@google.com>2021-06-22 17:02:41 +0000
commit541612b9746c1c314884af4079bfe8d340aaf953 (patch)
tree3ccab036153b3b16772cf5b7b305a028bdd15166 /src/cmd/gofmt
parent3e6219c6a9472e266d504d443b065e5a3e265a64 (diff)
downloadgo-541612b9746c1c314884af4079bfe8d340aaf953.tar.gz
go-541612b9746c1c314884af4079bfe8d340aaf953.zip
[dev.typeparams] cmd/gofmt: remove typeparams guards
Remove logic related to guarding against allowing type parameters from cmd/gofmt. At this point, it was only restricting tests. Change-Id: Idd198389aaa422636d61af547a37be49f3be6c97 Reviewed-on: https://go-review.googlesource.com/c/go/+/329931 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
Diffstat (limited to 'src/cmd/gofmt')
-rw-r--r--src/cmd/gofmt/doc.go3
-rw-r--r--src/cmd/gofmt/gofmt_test.go7
-rw-r--r--src/cmd/gofmt/gofmt_typeparams_test.go12
-rw-r--r--src/cmd/gofmt/testdata/typeparams.golden2
-rw-r--r--src/cmd/gofmt/testdata/typeparams.input2
5 files changed, 2 insertions, 24 deletions
diff --git a/src/cmd/gofmt/doc.go b/src/cmd/gofmt/doc.go
index 68476e7d44..e340665594 100644
--- a/src/cmd/gofmt/doc.go
+++ b/src/cmd/gofmt/doc.go
@@ -26,9 +26,6 @@ The flags are:
Do not print reformatted sources to standard output.
If a file's formatting is different from gofmt's, print its name
to standard output.
- -G
- Allow generic code, using type parameters.
- See golang.org/issues/43651 for more information.
-r rule
Apply the rewrite rule to the source before reformatting.
-s
diff --git a/src/cmd/gofmt/gofmt_test.go b/src/cmd/gofmt/gofmt_test.go
index f0d3f8780f..9ef7676214 100644
--- a/src/cmd/gofmt/gofmt_test.go
+++ b/src/cmd/gofmt/gofmt_test.go
@@ -54,8 +54,6 @@ func gofmtFlags(filename string, maxLines int) string {
return ""
}
-var typeParamsEnabled = false
-
func runTest(t *testing.T, in, out string) {
// process flags
*simplifyAST = false
@@ -78,11 +76,6 @@ func runTest(t *testing.T, in, out string) {
case "-stdin":
// fake flag - pretend input is from stdin
stdin = true
- case "-G":
- // fake flag - test is for generic code
- if !typeParamsEnabled {
- return
- }
default:
t.Errorf("unrecognized flag name: %s", name)
}
diff --git a/src/cmd/gofmt/gofmt_typeparams_test.go b/src/cmd/gofmt/gofmt_typeparams_test.go
deleted file mode 100644
index 10641a77cb..0000000000
--- a/src/cmd/gofmt/gofmt_typeparams_test.go
+++ /dev/null
@@ -1,12 +0,0 @@
-// Copyright 2021 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-//go:build typeparams
-// +build typeparams
-
-package main
-
-func init() {
- typeParamsEnabled = true
-}
diff --git a/src/cmd/gofmt/testdata/typeparams.golden b/src/cmd/gofmt/testdata/typeparams.golden
index 35f08d1379..f71bd130db 100644
--- a/src/cmd/gofmt/testdata/typeparams.golden
+++ b/src/cmd/gofmt/testdata/typeparams.golden
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//gofmt -G
+//gofmt
package typeparams
diff --git a/src/cmd/gofmt/testdata/typeparams.input b/src/cmd/gofmt/testdata/typeparams.input
index 7f3212c8e4..5d4c53d9f7 100644
--- a/src/cmd/gofmt/testdata/typeparams.input
+++ b/src/cmd/gofmt/testdata/typeparams.input
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//gofmt -G
+//gofmt
package typeparams