@@ -71,7 +71,7 @@ func (a *arrayFlags) Set(value string) error {
71
71
}
72
72
73
73
var (
74
- //#nosec flag
74
+ // #nosec flag
75
75
flagIgnoreNoSec = flag .Bool ("nosec" , false , "Ignores #nosec comments when set" )
76
76
77
77
// show ignored
80
80
// format output
81
81
flagFormat = flag .String ("fmt" , "text" , "Set output format. Valid options are: json, yaml, csv, junit-xml, html, sonarqube, golint, sarif or text" )
82
82
83
- //#nosec alternative tag
83
+ // #nosec alternative tag
84
84
flagAlternativeNoSec = flag .String ("nosec-tag" , "" , "Set an alternative string for #nosec. Some examples: #dontanalyze, #falsepositive" )
85
85
86
86
// output file
@@ -148,7 +148,7 @@ var (
148
148
logger * log.Logger
149
149
)
150
150
151
- //#nosec
151
+ // #nosec
152
152
func usage () {
153
153
usageText := fmt .Sprintf (usageText , Version , GitTag , BuildDate )
154
154
fmt .Fprintln (os .Stderr , usageText )
@@ -173,12 +173,12 @@ func usage() {
173
173
func loadConfig (configFile string ) (gosec.Config , error ) {
174
174
config := gosec .NewConfig ()
175
175
if configFile != "" {
176
- //#nosec
176
+ // #nosec
177
177
file , err := os .Open (configFile )
178
178
if err != nil {
179
179
return nil , err
180
180
}
181
- defer file .Close () //#nosec G307
181
+ defer file .Close () // #nosec G307
182
182
if _ , err := config .ReadFrom (file ); err != nil {
183
183
return nil , err
184
184
}
@@ -253,11 +253,11 @@ func printReport(format string, color bool, rootPaths []string, reportInfo *gose
253
253
}
254
254
255
255
func saveReport (filename , format string , rootPaths []string , reportInfo * gosec.ReportInfo ) error {
256
- outfile , err := os .Create (filename ) //#nosec G304
256
+ outfile , err := os .Create (filename ) // #nosec G304
257
257
if err != nil {
258
258
return err
259
259
}
260
- defer outfile .Close () //#nosec G307
260
+ defer outfile .Close () // #nosec G307
261
261
err = report .CreateReport (outfile , format , false , rootPaths , reportInfo )
262
262
if err != nil {
263
263
return err
@@ -337,7 +337,7 @@ func main() {
337
337
338
338
// Ensure at least one file was specified or that the recursive -r flag was set.
339
339
if flag .NArg () == 0 && ! * flagRecursive {
340
- fmt .Fprintf (os .Stderr , "\n Error: FILE [FILE...] or './...' or -r expected\n " ) //#nosec
340
+ fmt .Fprintf (os .Stderr , "\n Error: FILE [FILE...] or './...' or -r expected\n " ) // #nosec
341
341
flag .Usage ()
342
342
os .Exit (1 )
343
343
}
@@ -460,7 +460,7 @@ func main() {
460
460
}
461
461
462
462
// Finalize logging
463
- logWriter .Close () //#nosec
463
+ logWriter .Close () // #nosec
464
464
465
465
exit (issues , errors , * flagNoFail )
466
466
}
0 commit comments