Commit 43345a11 authored by Robert Griesemer's avatar Robert Griesemer

go/parser: initialize file set even in only some tests are run

Without this fix, some tests crashed (e.g. go test -run Invalid).

LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/133580043
parent fa9f3058
......@@ -34,7 +34,7 @@ import (
const testdata = "testdata"
var fsetErrs *token.FileSet
var fsetErrs = token.NewFileSet()
// getFile assumes that each filename occurs at most once
func getFile(filename string) (file *token.File) {
......@@ -169,7 +169,6 @@ func checkErrors(t *testing.T, filename string, input interface{}) {
}
func TestErrors(t *testing.T) {
fsetErrs = token.NewFileSet()
list, err := ioutil.ReadDir(testdata)
if err != nil {
t.Fatal(err)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment