exercism/go/weather-forecast/weather_forecast.go
2022-08-24 14:28:45 +02:00

14 lines
567 B
Go

// Package weather contains functions for forecasting the weather at a given location.
package weather
// CurrentCondition stores the current weather condition.
var CurrentCondition string
// CurrentLocation stores the current location for the weather forecast.
var CurrentLocation string
// Forecast takes a city and location as an argument and returns the current weather condition.
func Forecast(city, condition string) string {
CurrentLocation, CurrentCondition = city, condition
return CurrentLocation + " - current weather condition: " + CurrentCondition
}