From 51ca21064fc15b860fcd59e386b4a67009f68fc0 Mon Sep 17 00:00:00 2001 From: Taras Madan Date: Fri, 14 Feb 2025 12:42:25 +0100 Subject: pkg/cover: typo in var name Typo fix introduced the var name shadowing thus it is easier to remove the intermediate var. --- pkg/cover/html.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'pkg/cover/html.go') 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]), } } -- cgit mrf-deployment