aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/cover
diff options
context:
space:
mode:
authorTaras Madan <tarasmadan@google.com>2025-02-14 12:42:25 +0100
committerTaras Madan <tarasmadan@google.com>2025-02-14 11:58:42 +0000
commit51ca21064fc15b860fcd59e386b4a67009f68fc0 (patch)
treeb3accd19d4d7b5645ef06e4704dbae010849ee37 /pkg/cover
parentb213ff4f647eceb031e112b65f815273de234074 (diff)
pkg/cover: typo in var name
Typo fix introduced the var name shadowing thus it is easier to remove the intermediate var.
Diffstat (limited to 'pkg/cover')
-rw-r--r--pkg/cover/html.go22
1 files changed, 11 insertions, 11 deletions
diff --git a/pkg/cover/html.go b/pkg/cover/html.go
index 5d65df93a..599db6141 100644
--- a/pkg/cover/html.go
+++ b/pkg/cover/html.go
@@ -548,18 +548,18 @@ func groupCoverByModule(datas []fileStats) map[string]map[string]string {
if totalFuncs[m] != 0 {
percentCoveredFunc[m] = 100.0 * float64(coveredFuncs[m]) / float64(totalFuncs[m])
}
- lines := fmt.Sprintf("%v / %v / %.2f%%", coveredLines[m], totalLines[m], percentLines[m])
- pcsInFiles := fmt.Sprintf("%v / %v / %.2f%%", coveredPCsInFile[m], totalPCsInFile[m], percentPCsInFile[m])
- funcs := fmt.Sprintf("%v / %v / %.2f%%", coveredFuncs[m], totalFuncs[m], percentCoveredFunc[m])
- pcsInFuncs := fmt.Sprintf("%v / %v / %.2f%%", coveredPCsInFuncs[m], pcsInFuncs[m], percentPCsInFunc[m])
- covedFuncs := fmt.Sprintf("%v / %v / %.2f%%", coveredPCsInFuncs[m], pcsInCoveredFuncs[m], percentInCoveredFunc[m])
d[m] = map[string]string{
- "name": m,
- "lines": lines,
- "PCsInFiles": pcsInFiles,
- "Funcs": funcs,
- "PCsInFuncs": pcsInFuncs,
- "PCsInCoveredFuncs": covedFuncs,
+ "name": m,
+ "lines": fmt.Sprintf("%v / %v / %.2f%%",
+ coveredLines[m], totalLines[m], percentLines[m]),
+ "PCsInFiles": fmt.Sprintf("%v / %v / %.2f%%",
+ coveredPCsInFile[m], totalPCsInFile[m], percentPCsInFile[m]),
+ "Funcs": fmt.Sprintf("%v / %v / %.2f%%",
+ coveredFuncs[m], totalFuncs[m], percentCoveredFunc[m]),
+ "PCsInFuncs": fmt.Sprintf("%v / %v / %.2f%%",
+ coveredPCsInFuncs[m], pcsInFuncs[m], percentPCsInFunc[m]),
+ "PCsInCoveredFuncs": fmt.Sprintf("%v / %v / %.2f%%",
+ coveredPCsInFuncs[m], pcsInCoveredFuncs[m], percentInCoveredFunc[m]),
}
}