mirror of
https://github.com/gojp/goreportcard.git
synced 2026-01-28 22:39:05 +08:00
#95 remove extra var
This commit is contained in:
@@ -126,8 +126,6 @@ func GoTool(dir string, filenames, command []string) (float64, []FileSummary, er
|
||||
|
||||
out := bufio.NewScanner(stdout)
|
||||
|
||||
githubLink := strings.TrimPrefix(dir, "repos/src")
|
||||
|
||||
// the same file can appear multiple times out of order
|
||||
// in the output, so we can't go line by line, have to store
|
||||
// a map of filename to FileSummary
|
||||
@@ -150,9 +148,9 @@ outer:
|
||||
if len(strings.Split(base, "/")) >= 3 {
|
||||
pkg = strings.Split(base, "/")[2]
|
||||
}
|
||||
fileURL = "https://" + fmt.Sprintf("github.com/golang/%s", pkg) + "/blob/master" + strings.TrimPrefix(filename, githubLink)
|
||||
fileURL = "https://" + fmt.Sprintf("github.com/golang/%s", pkg) + "/blob/master" + strings.TrimPrefix(filename, "/"+base)
|
||||
default:
|
||||
fileURL = "https://" + strings.TrimPrefix(dir, "repos/src/") + "/blob/master" + strings.TrimPrefix(filename, githubLink)
|
||||
fileURL = "https://" + base + "/blob/master" + strings.TrimPrefix(filename, "/"+base)
|
||||
}
|
||||
fs := fsMap[filename]
|
||||
if fs.Filename == "" {
|
||||
|
||||
Reference in New Issue
Block a user