From c77f09008529964b13c22a788fafcf60cd247cae Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Mon, 25 Oct 2010 17:44:54 -0700 Subject: [PATCH] go/scanner: delete unnecessary type declarations R=rsc, r2 CC=golang-dev https://golang.org/cl/2735041 --- src/pkg/go/scanner/scanner_test.go | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/pkg/go/scanner/scanner_test.go b/src/pkg/go/scanner/scanner_test.go index 0e4256ef40c..e2ffb1e0cf6 100644 --- a/src/pkg/go/scanner/scanner_test.go +++ b/src/pkg/go/scanner/scanner_test.go @@ -427,14 +427,11 @@ func TestSemis(t *testing.T) { } -type seg struct { +var segments = []struct { srcline string // a line of source text filename string // filename for current token line int // line number for current token -} - - -var segments = []seg{ +}{ // exactly one token per line since the test consumes one token per segment {" line1", "TestLineComments", 1}, {"\nline2", "TestLineComments", 2}, @@ -604,14 +601,12 @@ func checkError(t *testing.T, src string, tok token.Token, pos int, err string) } -type srcerr struct { +var errors = []struct { src string tok token.Token pos int err string -} - -var errors = []srcerr{ +}{ {"\"\"", token.STRING, 0, ""}, {"\"", token.STRING, 0, "string not terminated"}, {"/**/", token.COMMENT, 0, ""},