diff --git a/main.go b/main.go index fab9c68..b83fc09 100644 --- a/main.go +++ b/main.go @@ -131,8 +131,8 @@ func generateParamFormat() (string, bool, error) { return "?format=3", downloadMode, nil } - for i := range switches { - if *switches[i] { + for i, s := range switches { + if *s { params.WriteString(switchesFlags[i]) } } @@ -166,7 +166,7 @@ var ( location = app.Flag("location", "Specify explicite location (--expert-mode)").Short('L').OverrideDefaultFromEnvar("GO_CMW_LOCATION").String() language = app.Flag("language", "Specify explicite language (--expert-mode)").Short('l').OverrideDefaultFromEnvar("GO_CMW_LANGUAGE").String() v2 = app.Flag("v2", "Display Data-Rich output").Default("false").Bool() - switches = [13]*bool{ + switches = []*bool{ app.Flag("metric", "Display weather in metric").Short('m').Default("false").Bool(), app.Flag("uscs", "Display weather in imperial").Short('u').Default("false").Bool(), app.Flag("meter-second", "Display wind in m/s").Short('M').Default("false").Bool(),