From 8cdf491cb5649c027a2aaa06a10bc6904a17b91a Mon Sep 17 00:00:00 2001 From: Igor Chubin Date: Fri, 23 Dec 2022 16:59:36 +0100 Subject: [PATCH] Fix whitespace findings --- internal/view/v1/format.go | 5 ----- internal/view/v1/view1.go | 4 ---- 2 files changed, 9 deletions(-) diff --git a/internal/view/v1/format.go b/internal/view/v1/format.go index 3e51e56..7a4edb2 100644 --- a/internal/view/v1/format.go +++ b/internal/view/v1/format.go @@ -268,7 +268,6 @@ func formatRain(c cond) string { rainUnit, unitRain(config.Imperial, config.Lang), c.ChanceOfRain), 15) - } return pad(fmt.Sprintf("%.1f %s", rainUnit, unitRain(config.Imperial, config.Lang)), 15) @@ -342,7 +341,6 @@ func formatCond(cur []string, c cond, current bool) (ret []string) { ret = append(ret, fmt.Sprintf("%v %v %v", cur[0], desc, icon[0]), fmt.Sprintf("%v %v %v", cur[1], formatTemp(c), icon[1]), fmt.Sprintf("%v %v %v", cur[2], formatWind(c), icon[2]), fmt.Sprintf("%v %v %v", cur[3], formatVisibility(c), icon[3]), fmt.Sprintf("%v %v %v", cur[4], formatRain(c), icon[4])) } else { ret = append(ret, fmt.Sprintf("%v %v %v", cur[0], icon[0], desc), fmt.Sprintf("%v %v %v", cur[1], icon[1], formatTemp(c)), fmt.Sprintf("%v %v %v", cur[2], icon[2], formatWind(c)), fmt.Sprintf("%v %v %v", cur[3], icon[3], formatVisibility(c)), fmt.Sprintf("%v %v %v", cur[4], icon[4], formatRain(c))) - } return @@ -358,7 +356,6 @@ func justifyCenter(s string, width int) string { s = " " + s appendSide = 1 } - } return s @@ -368,7 +365,6 @@ func reverse(s string) string { r := []rune(s) for i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 { r[i], r[j] = r[j], r[i] - } return string(r) @@ -393,7 +389,6 @@ func pad(s string, mustLen int) (ret string) { } else { ret = fmt.Sprintf("%s%s%s", toks[0], esc, pad(toks[1], mustLen-tokLen)) } - } return diff --git a/internal/view/v1/view1.go b/internal/view/v1/view1.go index d4f5615..3a5aac0 100644 --- a/internal/view/v1/view1.go +++ b/internal/view/v1/view1.go @@ -49,10 +49,8 @@ func printDay(w weather) (ret []string) { // dateFmt := "┤ " + d.Format("Mon 02. Jan") + " ├" if val, ok := locale[config.Lang]; ok { - lctime.SetLocale(val) } else { - lctime.SetLocale("en_US") } dateName := "" @@ -89,7 +87,6 @@ func printDay(w weather) (ret []string) { trans = t } if config.Narrow { - names := "│ " + justifyCenter(trans[1], 16) + "└──────┬──────┘" + justifyCenter(trans[3], 16) + " │" @@ -103,7 +100,6 @@ func printDay(w weather) (ret []string) { return append(ret, "└──────────────────────────────┴──────────────────────────────┘") - } names := ""