From 7fb8943f4739d83bd4d5867bef5f731e62920baa Mon Sep 17 00:00:00 2001 From: Shawn Smith Date: Mon, 13 Jun 2016 01:15:34 +0900 Subject: [PATCH] #95 remove extra var --- check/utils.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/check/utils.go b/check/utils.go index 4e294bf..cd115d0 100644 --- a/check/utils.go +++ b/check/utils.go @@ -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 == "" {