added a few more weather cond.
This commit is contained in:
		
							parent
							
								
									38a2b51ea5
								
							
						
					
					
						commit
						05c80dd5a0
					
				
							
								
								
									
										23
									
								
								weather.go
									
									
									
									
									
								
							
							
						
						
									
										23
									
								
								weather.go
									
									
									
									
									
								
							| @ -68,22 +68,29 @@ type Sys struct { | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func iconToEmoji(icon string) { | func iconToEmoji(icon string) { | ||||||
| 	var em string | 	//info. from https://openweathermap.org/weather-conditions | ||||||
|  | 	var emoji string | ||||||
| 	switch icon { | 	switch icon { | ||||||
| 	case "Clouds": | 	case "Clouds": | ||||||
| 		em = "☁️" | 		emoji = "☁️" | ||||||
| 	case "Drizzle": | 	case "Drizzle": | ||||||
| 		em = "🌧️" | 		emoji = "🌧️" | ||||||
| 	case "Rain": | 	case "Rain": | ||||||
| 		em = "🌧️" | 		emoji = "🌧️" | ||||||
| 	case "Snow": | 	case "Snow": | ||||||
| 		em = "❄️" | 		emoji = "❄️" | ||||||
| 	case "Clear": | 	case "Clear": | ||||||
| 		em = "☀️" | 		emoji = "☀️" | ||||||
|  | 	case "Mist": | ||||||
|  | 		emoji = "🌫️" | ||||||
|  | 	case "Tornado": | ||||||
|  | 		emoji = "🌪️" | ||||||
|  | 	case "Thunderstorm": | ||||||
|  | 		emoji = "⛈" | ||||||
| 	default: | 	default: | ||||||
| 		em = "☀️" | 		emoji = "️❓" | ||||||
| 	} | 	} | ||||||
| 	fmt.Print(em) | 	fmt.Print(emoji) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func printWeather(data WeatherAPI) { | func printWeather(data WeatherAPI) { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user