File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -199,16 +199,18 @@ func (gosec *Analyzer) parseErrors(pkg *packages.Package) error {
199
199
var err error
200
200
var line , column int
201
201
var errorMsg string
202
- if len (infoErr ) == 3 {
202
+ if len (infoErr ) == 4 {
203
203
if line , err = strconv .Atoi (infoErr [1 ]); err != nil {
204
204
return fmt .Errorf ("parsing line: %v" , err )
205
205
}
206
206
if column , err = strconv .Atoi (infoErr [2 ]); err != nil {
207
207
return fmt .Errorf ("parsing column: %v" , err )
208
208
}
209
209
errorMsg = strings .TrimSpace (infoErr [3 ])
210
- } else {
210
+ } else if len ( infoErr ) > 1 {
211
211
errorMsg = strings .TrimSpace (infoErr [1 ])
212
+ } else {
213
+ return fmt .Errorf ("cannot parse error %q" , infoErr )
212
214
}
213
215
newErr := NewError (line , column , errorMsg )
214
216
if errSlice , ok := gosec .errors [filePath ]; ok {
You can’t perform that action at this time.
0 commit comments