From 950e84c3faedf82edfb004be25773f39e6403c5f Mon Sep 17 00:00:00 2001 From: Cosmin Cojocar Date: Thu, 25 Apr 2019 09:31:24 +0200 Subject: [PATCH] Handle errors to fix lint warnings Signed-off-by: Cosmin Cojocar --- output/formatter.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/output/formatter.go b/output/formatter.go index 1c689c6..e29664c 100644 --- a/output/formatter.go +++ b/output/formatter.go @@ -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",