mirror of
https://github.com/gojp/goreportcard.git
synced 2026-01-28 22:39:05 +08:00
check len s before assigning loc for gocyclo
This commit is contained in:
@@ -95,7 +95,9 @@ func getFileSummary(filename, dir, cmd, out string) (FileSummary, error) {
|
||||
var loc string
|
||||
if cmd == "gocyclo" {
|
||||
s := strings.SplitN(sp, " ", 2)
|
||||
loc = s[1]
|
||||
if len(s) > 1 {
|
||||
loc = s[1]
|
||||
}
|
||||
} else {
|
||||
s := strings.SplitN(sp, ": ", 2)
|
||||
loc = s[0]
|
||||
|
||||
Reference in New Issue
Block a user