Skip to content

Commit

Permalink
go-fuzz-build: parenthesize imports
Browse files Browse the repository at this point in the history
And give them a plausible position.

Fixes #294 again, hopefully for the last time
  • Loading branch information
josharian committed Nov 15, 2020
1 parent 8f656aa commit 0701ec3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion go-fuzz-build/cover.go
Original file line number Diff line number Diff line change
Expand Up @@ -653,10 +653,12 @@ func (f *File) addImport(path, name, anyIdent string) {
},
}
impDecl := &ast.GenDecl{
Tok: token.IMPORT,
Lparen: f.astFile.Name.End(),
Tok: token.IMPORT,
Specs: []ast.Spec{
newImport,
},
Rparen: f.astFile.Name.End(),
}
// Make the new import the first Decl in the file.
astFile := f.astFile
Expand Down

0 comments on commit 0701ec3

Please sign in to comment.