Skip to content

Commit

Permalink
Handle errors to fix lint warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Cosmin Cojocar <cosmin.cojocar@gmx.ch>
  • Loading branch information
ccojocar authored and Cosmin Cojocar committed Apr 27, 2019
1 parent ee73b9e commit 950e84c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions output/formatter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 950e84c

Please sign in to comment.