From 0950d8f56d50cb83c662ae4cc6b0d96f5ece5df0 Mon Sep 17 00:00:00 2001 From: Christian Zunker Date: Tue, 17 Oct 2023 07:25:33 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20some=20typos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian Zunker --- cli/reporter/json.go | 2 +- cli/reporter/print.go | 2 +- cli/reporter/print_compact.go | 8 ++++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/cli/reporter/json.go b/cli/reporter/json.go index e63d9b57..ec7bec96 100644 --- a/cli/reporter/json.go +++ b/cli/reporter/json.go @@ -51,7 +51,7 @@ func prepareAssetsForPrinting(assets map[string]*inventory.Asset) map[string]*as Mrn: a.Mrn, Name: a.Name, Url: a.Url, - PlatformName: getPlatforNameForAsset(a), + PlatformName: getPlatformNameForAsset(a), } printableAssets[k] = pAsset } diff --git a/cli/reporter/print.go b/cli/reporter/print.go index a175858f..d2a1dca3 100644 --- a/cli/reporter/print.go +++ b/cli/reporter/print.go @@ -69,7 +69,7 @@ func (r *Reporter) scoreColored(rating policy.ScoreRating, s string) string { return s } -func getPlatforNameForAsset(asset *inventory.Asset) string { +func getPlatformNameForAsset(asset *inventory.Asset) string { platformName := "" if asset.Platform != nil { if asset.Platform.Title == "" { diff --git a/cli/reporter/print_compact.go b/cli/reporter/print_compact.go index 6ab1fe8d..4a178ede 100644 --- a/cli/reporter/print_compact.go +++ b/cli/reporter/print_compact.go @@ -90,7 +90,7 @@ func (r *defaultReporter) printSummary(orderedAssets []assetMrnName) { if val, ok := asset.Labels["mondoo.com/project-id"]; ok { projectId = val } - platformName := getPlatforNameForAsset(asset) + platformName := getPlatformNameForAsset(asset) if platformName != "" { assetsByPlatform[platformName] = append(assetsByPlatform[platformName], asset) } @@ -105,7 +105,11 @@ func (r *defaultReporter) printSummary(orderedAssets []assetMrnName) { } if len(assetsByScore) > 0 { - header := fmt.Sprintf("Scanned %d assets", len(r.data.Assets)) + assetsString := "asset" + if len(r.data.Assets) > 1 { + assetsString = "assets" + } + header := fmt.Sprintf("Scanned %d %s", len(r.data.Assets), assetsString) r.out.Write([]byte(termenv.String(header + NewLineCharacter).Foreground(r.Colors.Primary).String())) }