Fix whitespace findings

chubin/logging
Igor Chubin 2 years ago
parent bebbc32353
commit 8cdf491cb5

@ -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

@ -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 := ""

Loading…
Cancel
Save