chore: Add newline
Signed-off-by: Tim Hårek Andreassen <tim@harek.no>
This commit is contained in:
parent
56cd590025
commit
a638c0b678
1 changed files with 12 additions and 2 deletions
14
cmd/now.go
14
cmd/now.go
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue