Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions solutions/go/weather-forecast/1/weather_forecast.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Package weather provides information about current weather conditions and forecasts.
package weather

var (
// CurrentCondition Stores the current weather condition.
CurrentCondition string
// CurrentLocation Stores the current location.
CurrentLocation string
)

// Forecast generates a weather forecast string based on the provided city and condition.
// It updates the CurrentLocation and CurrentCondition variables with the input values,
// then returns a formatted string indicating the location and current weather.
func Forecast(city, condition string) string {
CurrentLocation, CurrentCondition = city, condition
return CurrentLocation + " - current weather condition: " + CurrentCondition
}