mirror of
https://github.com/securego/gosec.git
synced 2025-04-13 11:40:37 +02:00
Handle errors to fix lint warnings
Signed-off-by: Cosmin Cojocar <cosmin.cojocar@gmx.ch>
This commit is contained in:
parent
ee73b9e94b
commit
950e84c3fa
@ -109,10 +109,16 @@ func reportSonarqube(rootPath string, w io.Writer, data *reportInfo) error {
|
||||
for _, issue := range data.Issues {
|
||||
lines := strings.Split(issue.Line, "-")
|
||||
|
||||
startLine, _ := strconv.Atoi(lines[0])
|
||||
startLine, err := strconv.Atoi(lines[0])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
endLine := startLine
|
||||
if len(lines) > 1 {
|
||||
endLine, _ = strconv.Atoi(lines[1])
|
||||
endLine, err = strconv.Atoi(lines[1])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
s := sonarIssue{
|
||||
EngineID: "gosec",
|
||||
|
Loading…
x
Reference in New Issue
Block a user