We don't need the distinction anymore.
Also, made corresponding adjustments to check_test.go.
Change-Id: I3c9a768c16a251d76bc6b3ebabd37822773e4ef5
Reviewed-on: https://go-review.googlesource.com/c/go/+/393657
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
t.Fatal(err)
}
- // TODO(gri) remove this or use flag mechanism to set mode if still needed
- var mode syntax.Mode
- if strings.HasSuffix(filenames[0], ".go2") || manual {
- mode |= syntax.AllowGenerics | syntax.AllowMethodTypeParams
- }
- // parse files and collect parser errors
- files, errlist := parseFiles(t, filenames, mode)
+ files, errlist := parseFiles(t, filenames, syntax.AllowGenerics|syntax.AllowMethodTypeParams)
pkgName := "<no package>"
if len(files) > 0 {
//
// go test -run Manual -- foo.go bar.go
//
-// If no source arguments are provided, the file testdata/manual.go2
+// If no source arguments are provided, the file testdata/manual.go
// is used instead.
// Provide the -verify flag to verify errors against ERROR comments
// in the input files rather than having a list of errors reported.
filenames := flag.Args()
if len(filenames) == 0 {
- filenames = []string{filepath.FromSlash("testdata/manual.go2")}
+ filenames = []string{filepath.FromSlash("testdata/manual.go")}
}
info, err := os.Stat(filenames[0])
"fmt"
"go/ast"
"go/importer"
- "go/internal/typeparams"
"go/parser"
"go/scanner"
"go/token"
t.Skip("type params are enabled")
}
- mode := parser.AllErrors
- if !strings.HasSuffix(filenames[0], ".go2") && !manual {
- mode |= typeparams.DisallowParsing
- }
-
- // parse files and collect parser errors
- files, errlist := parseFiles(t, filenames, srcs, mode)
+ files, errlist := parseFiles(t, filenames, srcs, parser.AllErrors)
pkgName := "<no package>"
if len(files) > 0 {
//
// go test -run Manual -- foo.go bar.go
//
-// If no source arguments are provided, the file testdata/manual.go2
+// If no source arguments are provided, the file testdata/manual.go
// is used instead.
// Provide the -verify flag to verify errors against ERROR comments
// in the input files rather than having a list of errors reported.
filenames := flag.Args()
if len(filenames) == 0 {
- filenames = []string{filepath.FromSlash("testdata/manual.go2")}
+ filenames = []string{filepath.FromSlash("testdata/manual.go")}
}
info, err := os.Stat(filenames[0])