Skip to content

Commit 23c86e8

Browse files
committed
internal/typeparams: delete const Enabled=true and simplify
Change-Id: I8e95226d03d94027aee803a0431320bc7ee83600 Reviewed-on: https://go-review.googlesource.com/c/tools/+/549235 Reviewed-by: Robert Findley <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent e46688f commit 23c86e8

File tree

60 files changed

+93
-665
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+93
-665
lines changed

cmd/stringer/endtoend_test.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import (
2323
"testing"
2424

2525
"golang.org/x/tools/internal/testenv"
26-
"golang.org/x/tools/internal/typeparams"
2726
)
2827

2928
// This file contains a test that compiles and runs each program in testdata
@@ -62,9 +61,6 @@ func TestEndToEnd(t *testing.T) {
6261
if err != nil {
6362
t.Fatalf("Readdirnames: %s", err)
6463
}
65-
if typeparams.Enabled {
66-
names = append(names, moreTests(t, "testdata/typeparams", "typeparams")...)
67-
}
6864
// Generate, compile, and run the test programs.
6965
for _, name := range names {
7066
if name == "typeparams" {
File renamed without changes.
File renamed without changes.

go/analysis/passes/assign/assign_test.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,9 @@ import (
99

1010
"golang.org/x/tools/go/analysis/analysistest"
1111
"golang.org/x/tools/go/analysis/passes/assign"
12-
"golang.org/x/tools/internal/typeparams"
1312
)
1413

1514
func Test(t *testing.T) {
1615
testdata := analysistest.TestData()
17-
tests := []string{"a"}
18-
if typeparams.Enabled {
19-
tests = append(tests, "typeparams")
20-
}
21-
analysistest.RunWithSuggestedFixes(t, testdata, assign.Analyzer, tests...)
16+
analysistest.RunWithSuggestedFixes(t, testdata, assign.Analyzer, "a", "typeparams")
2217
}

go/analysis/passes/atomic/atomic_test.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,9 @@ import (
99

1010
"golang.org/x/tools/go/analysis/analysistest"
1111
"golang.org/x/tools/go/analysis/passes/atomic"
12-
"golang.org/x/tools/internal/typeparams"
1312
)
1413

1514
func Test(t *testing.T) {
1615
testdata := analysistest.TestData()
17-
tests := []string{"a"}
18-
if typeparams.Enabled {
19-
tests = append(tests, "typeparams")
20-
}
21-
analysistest.Run(t, testdata, atomic.Analyzer, tests...)
16+
analysistest.Run(t, testdata, atomic.Analyzer, "a", "typeparams")
2217
}

go/analysis/passes/bools/bools_test.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,9 @@ import (
99

1010
"golang.org/x/tools/go/analysis/analysistest"
1111
"golang.org/x/tools/go/analysis/passes/bools"
12-
"golang.org/x/tools/internal/typeparams"
1312
)
1413

1514
func Test(t *testing.T) {
1615
testdata := analysistest.TestData()
17-
tests := []string{"a"}
18-
if typeparams.Enabled {
19-
tests = append(tests, "typeparams")
20-
}
21-
analysistest.Run(t, testdata, bools.Analyzer, tests...)
16+
analysistest.Run(t, testdata, bools.Analyzer, "a", "typeparams")
2217
}

go/analysis/passes/buildssa/buildssa_test.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111

1212
"golang.org/x/tools/go/analysis/analysistest"
1313
"golang.org/x/tools/go/analysis/passes/buildssa"
14-
"golang.org/x/tools/internal/typeparams"
1514
)
1615

1716
func Test(t *testing.T) {
@@ -30,9 +29,6 @@ func Test(t *testing.T) {
3029
}
3130

3231
func TestGenericDecls(t *testing.T) {
33-
if !typeparams.Enabled {
34-
t.Skip("TestGenericDecls requires type parameters.")
35-
}
3632
testdata := analysistest.TestData()
3733
result := analysistest.Run(t, testdata, buildssa.Analyzer, "b")[0].Result
3834

@@ -48,9 +44,6 @@ func TestGenericDecls(t *testing.T) {
4844
}
4945

5046
func TestImporting(t *testing.T) {
51-
if !typeparams.Enabled {
52-
t.Skip("TestImporting depends on testdata/b/b/go which uses type parameters.")
53-
}
5447
testdata := analysistest.TestData()
5548
result := analysistest.Run(t, testdata, buildssa.Analyzer, "c")[0].Result
5649

go/analysis/passes/cgocall/cgocall_test.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,9 @@ import (
99

1010
"golang.org/x/tools/go/analysis/analysistest"
1111
"golang.org/x/tools/go/analysis/passes/cgocall"
12-
"golang.org/x/tools/internal/typeparams"
1312
)
1413

1514
func Test(t *testing.T) {
1615
testdata := analysistest.TestData()
17-
tests := []string{"a", "b", "c"}
18-
if typeparams.Enabled {
19-
// and testdata/src/typeparams/typeparams.go when possible
20-
tests = append(tests, "typeparams")
21-
}
22-
analysistest.Run(t, testdata, cgocall.Analyzer, tests...)
16+
analysistest.Run(t, testdata, cgocall.Analyzer, "a", "b", "c", "typeparams")
2317
}

go/analysis/passes/composite/composite_test.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,9 @@ import (
99

1010
"golang.org/x/tools/go/analysis/analysistest"
1111
"golang.org/x/tools/go/analysis/passes/composite"
12-
"golang.org/x/tools/internal/typeparams"
1312
)
1413

1514
func Test(t *testing.T) {
1615
testdata := analysistest.TestData()
17-
pkgs := []string{"a"}
18-
if typeparams.Enabled {
19-
pkgs = append(pkgs, "typeparams")
20-
}
21-
analysistest.RunWithSuggestedFixes(t, testdata, composite.Analyzer, pkgs...)
16+
analysistest.RunWithSuggestedFixes(t, testdata, composite.Analyzer, "a", "typeparams")
2217
}

go/analysis/passes/copylock/copylock_test.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,9 @@ import (
99

1010
"golang.org/x/tools/go/analysis/analysistest"
1111
"golang.org/x/tools/go/analysis/passes/copylock"
12-
"golang.org/x/tools/internal/typeparams"
1312
)
1413

1514
func Test(t *testing.T) {
1615
testdata := analysistest.TestData()
17-
pkgs := []string{"a"}
18-
if typeparams.Enabled {
19-
pkgs = append(pkgs, "typeparams")
20-
}
21-
analysistest.Run(t, testdata, copylock.Analyzer, pkgs...)
16+
analysistest.Run(t, testdata, copylock.Analyzer, "a", "typeparams")
2217
}

0 commit comments

Comments
 (0)