we-lang.go: go format

pull/504/head
Igor Chubin 5 years ago
parent b85e5732ec
commit 149109dbba

@ -20,8 +20,8 @@ import (
"time"
"unicode/utf8"
"github.com/mattn/go-colorable"
"github.com/klauspost/lctime"
"github.com/mattn/go-colorable"
"github.com/mattn/go-runewidth"
)
@ -461,7 +461,7 @@ var (
"lt": {"Rytas", "Diena", "Vakaras", "Naktis"},
"lv": {"Rīts", "Diena", "Vakars", "Nakts"},
"mk": {"Утро", "Пладне", "Вечер", "Ноќ"},
"ml":{ "മോണിംഗ്", "മധ്യാഹ്നം", "വൈകുന്നേരം", "രാത്രി",},
"ml": {"മോണിംഗ്", "മധ്യാഹ്നം", "വൈകുന്നേരം", "രാത്രി"},
"nl": {"'s Ochtends", "'s Middags", "'s Avonds", "'s Nachts"},
"nb": {"Morgen", "Middag", "Kveld", "Natt"},
"nn": {"Morgon", "Middag", "Kveld", "Natt"},
@ -822,7 +822,7 @@ func formatCond(cur []string, c cond, current bool) (ret []string) {
}
}
}
if (config.RightToLeft) {
if config.RightToLeft {
ret = append(ret, fmt.Sprintf("%v %v %v", cur[0], desc, icon[0]))
ret = append(ret, fmt.Sprintf("%v %v %v", cur[1], formatTemp(c), icon[1]))
ret = append(ret, fmt.Sprintf("%v %v %v", cur[2], formatWind(c), icon[2]))
@ -887,7 +887,7 @@ func printDay(w weather) (ret []string) {
for i, s := range slots {
if config.Narrow {
if i == 0 || i == 2 {
continue;
continue
}
}
ret = formatCond(ret, s, false)
@ -937,7 +937,7 @@ func printDay(w weather) (ret []string) {
if t, ok := daytimeTranslation[config.Lang]; ok {
trans = t
}
if (config.Narrow) {
if config.Narrow {
names := "│ " + justifyCenter(trans[1], 16) +
"└──────┬──────┘" + justifyCenter(trans[3], 16) + " │"
@ -1153,7 +1153,7 @@ func main() {
// r.Data.Req[0].Type,
fmt.Printf("Weather report: %s\n\n", locationName)
} else {
if (config.RightToLeft) {
if config.RightToLeft {
caption = locationName + " " + caption
space := strings.Repeat(" ", 125-runewidth.StringWidth(caption))
fmt.Printf("%s%s\n\n", space, caption)

Loading…
Cancel
Save