From 2798b1002aa7daa3a4d5da6a65942df0fbcd4200 Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Sat, 14 Nov 2020 14:06:34 -0800 Subject: [PATCH 1/2] go-fuzz-build: remove trailing whitespace in comments --- go-fuzz-build/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/go-fuzz-build/main.go b/go-fuzz-build/main.go index dc43ac2b4..e2d476929 100644 --- a/go-fuzz-build/main.go +++ b/go-fuzz-build/main.go @@ -62,8 +62,8 @@ func basePackagesConfig() *packages.Config { cfg := new(packages.Config) // Note that we do not set GO111MODULE here in order to respect any GO111MODULE - // setting by the user as we are finding dependencies. Note, however, that - // we are still setting up a GOPATH to build, so we later will force + // setting by the user as we are finding dependencies. Note, however, that + // we are still setting up a GOPATH to build, so we later will force // GO111MODULE to be off when building so that we are in GOPATH mode. // If the user has not set GO111MODULE, the meaning here is // left up to cmd/go (defaulting to 'auto' in Go 1.11-1.13, From 3a9992e202a84c6da889f51875284e4e0236520f Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Sat, 14 Nov 2020 14:07:25 -0800 Subject: [PATCH 2/2] go-fuzz-build: parenthesize imports And give them a plausible position. Fixes #294 again, hopefully for the last time --- go-fuzz-build/cover.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/go-fuzz-build/cover.go b/go-fuzz-build/cover.go index a06ef0661..070863d89 100644 --- a/go-fuzz-build/cover.go +++ b/go-fuzz-build/cover.go @@ -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