]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.typeparams] cmd/gofmt: remove typeparams guards
authorRob Findley <rfindley@google.com>
Tue, 22 Jun 2021 00:12:20 +0000 (20:12 -0400)
committerRobert Findley <rfindley@google.com>
Tue, 22 Jun 2021 17:02:41 +0000 (17:02 +0000)
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>
src/cmd/gofmt/doc.go
src/cmd/gofmt/gofmt_test.go
src/cmd/gofmt/gofmt_typeparams_test.go [deleted file]
src/cmd/gofmt/testdata/typeparams.golden
src/cmd/gofmt/testdata/typeparams.input

index 68476e7d4433d04da2c87ebfd0641aaba3a96597..e34066559415e76e6cbea9664d1a19939ca176fe 100644 (file)
@@ -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
index f0d3f8780f40e135f2e86f8d21e1feb61dbfecbd..9ef7676214c9f53a93aea54c39edae9580f0090c 100644 (file)
@@ -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 (file)
index 10641a7..0000000
+++ /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
-}
index 35f08d13792c70e458b0d14fe2c63b9c8c441d74..f71bd130db4ab075aa5f8296ff6315958688c82f 100644 (file)
@@ -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
 
index 7f3212c8e4a8d833045b8e066dd6d515f9ac1f42..5d4c53d9f767a97e0f9cff8be06b8a2662e9004b 100644 (file)
@@ -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