Skip to content

Commit c2c2155

Browse files
committed
Fix some gas warnings
1 parent 8b87505 commit c2c2155

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

cmd/gas/main.go

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,15 @@ func saveOutput(filename, format string, issues []*gas.Issue, metrics *gas.Metri
149149
return err
150150
}
151151
defer outfile.Close()
152-
output.CreateReport(outfile, format, issues, metrics)
152+
err = output.CreateReport(outfile, format, issues, metrics)
153+
if err != nil {
154+
return err
155+
}
153156
} else {
154-
output.CreateReport(os.Stdout, format, issues, metrics)
157+
err := output.CreateReport(os.Stdout, format, issues, metrics)
158+
if err != nil {
159+
return err
160+
}
155161
}
156162
return nil
157163
}
@@ -166,7 +172,7 @@ func main() {
166172

167173
// Ensure at least one file was specified
168174
if flag.NArg() == 0 {
169-
fmt.Fprintf(os.Stderr, "\nError: FILE [FILE...] or './...' expected\n")
175+
fmt.Fprintf(os.Stderr, "\nError: FILE [FILE...] or './...' expected\n") // #nosec
170176
flag.Usage()
171177
os.Exit(1)
172178
}
@@ -231,7 +237,7 @@ func main() {
231237
}
232238

233239
// Finialize logging
234-
logWriter.Close()
240+
logWriter.Close() // #nosec
235241

236242
// Do we have an issue? If so exit 1
237243
if issuesFound {

testutils/pkg.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ func (p *TestPackage) CreateContext(filename string) *gas.Context {
128128
// Close will delete the package and all files in that directory
129129
func (p *TestPackage) Close() {
130130
if p.ondisk {
131-
os.RemoveAll(p.Path)
131+
err := os.RemoveAll(p.Path)
132+
log.Println(err)
132133
}
133134
}

0 commit comments

Comments
 (0)