updated test in accordance with the reviewers notes

This commit is contained in:
David Tolpin 2018-11-27 02:13:35 +02:00
parent 093d5de35b
commit 2f168dc7ad
1 changed files with 2 additions and 5 deletions

View File

@ -745,18 +745,15 @@ func TestParenthesizedDecl(t *testing.T) {
fset := token.NewFileSet()
f, err := parser.ParseFile(fset, "", src, 0)
// reset the file set to get uniform formatting
fset = token.NewFileSet()
// print the original package
var buf bytes.Buffer
// Print the original package
err = Fprint(&buf, fset, f)
if err != nil {
t.Fatal(err)
}
original := buf.String()
// Now remove parentheses from the declaration
// now remove parentheses from the declaration
for i := 0; i != len(f.Decls); i++ {
f.Decls[i].(*ast.GenDecl).Lparen = token.NoPos
}