chore: Add newline

Signed-off-by: Tim Hårek Andreassen <tim@harek.no>
This commit is contained in:
Tim Hårek Andreassen 2024-10-02 21:04:58 +02:00
parent 56cd590025
commit a638c0b678
No known key found for this signature in database
GPG key ID: E59C7734F0E10EB5

View file

@ -4,6 +4,7 @@ import (
"encoding/json"
"fmt"
"os"
"time"
"git.sr.ht/~timharek/yr-go/cmd/flags"
"git.sr.ht/~timharek/yr-go/internal/nominatim"
@ -26,6 +27,8 @@ func init() {
func now(cmd *cobra.Command, args []string) {
isJson, err := cmd.Flags().GetBool(flags.JSON)
cobra.CheckErr(err)
isUTC, err := cmd.Flags().GetBool(flags.UTC)
cobra.CheckErr(err)
lon, _ := cmd.Flags().GetFloat64(flags.LON)
lat, _ := cmd.Flags().GetFloat64(flags.LAT)
@ -55,12 +58,19 @@ func now(cmd *cobra.Command, args []string) {
return
}
itemTime := n.Time.Local()
if isUTC {
itemTime = n.Time
}
fmt.Printf(
`Current forecast for %s
`%s now:
%s
Temperature: %.1f °C
Rain: %.1f mm
Wind: %.1f m/s from %s`,
Wind: %.1f m/s from %s
`,
n.Location,
itemTime.Format(time.DateTime),
n.Temperature,
n.Percipitation,
n.Wind.Speed,