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>
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
return ""
}
-var typeParamsEnabled = false
-
func runTest(t *testing.T, in, out string) {
// process flags
*simplifyAST = false
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)
}
+++ /dev/null
-// 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
-}
// 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
// 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