mirror of
https://github.com/securego/gosec.git
synced 2024-11-06 03:55:50 +00: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
1 changed files with 8 additions and 2 deletions
|
@ -109,10 +109,16 @@ func reportSonarqube(rootPath string, w io.Writer, data *reportInfo) error {
|
||||||
for _, issue := range data.Issues {
|
for _, issue := range data.Issues {
|
||||||
lines := strings.Split(issue.Line, "-")
|
lines := strings.Split(issue.Line, "-")
|
||||||
|
|
||||||
startLine, _ := strconv.Atoi(lines[0])
|
startLine, err := strconv.Atoi(lines[0])
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
endLine := startLine
|
endLine := startLine
|
||||||
if len(lines) > 1 {
|
if len(lines) > 1 {
|
||||||
endLine, _ = strconv.Atoi(lines[1])
|
endLine, err = strconv.Atoi(lines[1])
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
s := sonarIssue{
|
s := sonarIssue{
|
||||||
EngineID: "gosec",
|
EngineID: "gosec",
|
||||||
|
|
Loading…
Reference in a new issue