mirror of
https://github.com/golang/go
synced 2024-09-04 23:44:16 +00:00
[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>
This commit is contained in:
parent
3e6219c6a9
commit
541612b974
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
2
src/cmd/gofmt/testdata/typeparams.golden
vendored
2
src/cmd/gofmt/testdata/typeparams.golden
vendored
|
@ -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
|
||||
|
||||
|
|
2
src/cmd/gofmt/testdata/typeparams.input
vendored
2
src/cmd/gofmt/testdata/typeparams.input
vendored
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue