This commit is contained in:
2023-03-31 20:49:50 +00:00
parent 6e5450aa80
commit 5e6a433b92
15 changed files with 75 additions and 46 deletions

View File

@@ -5,13 +5,14 @@ import (
"strings"
)
const REMOTE_LOCATION string = "online"
// RemoteLocation is the string used to identify a online event
const RemoteLocation string = "online"
// GetCityFromLocation returns the city name of an event's location
func GetCityFromLocation(location string) string {
if location == REMOTE_LOCATION {
return fmt.Sprint("-", REMOTE_LOCATION)
if location == RemoteLocation {
return fmt.Sprint("-", RemoteLocation)
}
parts := strings.Split(location, " ")
index := -1