diff options
author | Robert Griesemer <gri@golang.org> | 2014-09-04 10:43:03 -0700 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2014-09-04 10:43:03 -0700 |
commit | 787642e90ea031bed3dc466b10ca83748280b62d (patch) | |
tree | b47ddaaf8a4c64f0f349ff89ef72b986b177317c /src | |
parent | c6839e238d4743d7c8c4d30aede1bd10a556d5e1 (diff) | |
download | go-787642e90ea031bed3dc466b10ca83748280b62d.tar.gz |
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://codereview.appspot.com/133580043
Diffstat (limited to 'src')
-rw-r--r-- | src/pkg/go/parser/error_test.go | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/pkg/go/parser/error_test.go b/src/pkg/go/parser/error_test.go index 8506077ce..48fb53e5b 100644 --- a/src/pkg/go/parser/error_test.go +++ b/src/pkg/go/parser/error_test.go @@ -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) |