@@ -131,8 +131,7 @@ func callAndUnmarshal(client *http.Client, page int, data *APICalendarResponse)
131131// getTime parses the start and end time of the event
132132func getTime (event RawEvent ) (time.Time , time.Time ) {
133133 instance := convert [map [string ]any ](
134- convert [map [string ]any ](
135- convert [[]any ](event .Event ["event_instances" ])[0 ])["event_instance" ])
134+ convert [map [string ]any ](convert [[]any ](event .Event ["event_instances" ])[0 ])["event_instance" ])
136135
137136 // Converts RFC3339 timestamp string to time.Time
138137 startTime , err := time .Parse (time .RFC3339 , convert [string ](instance ["start" ]))
@@ -164,28 +163,28 @@ func getEventLocation(event RawEvent) string {
164163
165164// getFilters parses the types, topics, and target audiences
166165func getFilters (event RawEvent ) ([]string , []string , []string ) {
167- types := []string {}
168- audiences := []string {}
169- topics := []string {}
166+ eventTypes := []string {}
167+ targetAudiences := []string {}
168+ eventTopics := []string {}
170169
171170 filters := convert [map [string ]any ](event .Event ["filters" ])
172171
173172 rawTypes := convert [[]any ](filters ["event_types" ])
174173 for _ , rawType := range rawTypes {
175- types = append (types , convert [string ](convert [map [string ]any ](rawType )["name" ]))
174+ eventTypes = append (eventTypes , convert [string ](convert [map [string ]any ](rawType )["name" ]))
176175 }
177176
178177 rawAudiences := convert [[]any ](filters ["event_target_audience" ])
179178 for _ , audience := range rawAudiences {
180- audiences = append (audiences , convert [string ](convert [map [string ]any ](audience )["name" ]))
179+ targetAudiences = append (targetAudiences , convert [string ](convert [map [string ]any ](audience )["name" ]))
181180 }
182181
183182 rawTopics := convert [[]any ](filters ["event_topic" ])
184183 for _ , topic := range rawTopics {
185- topics = append (topics , convert [string ](convert [map [string ]any ](topic )["name" ]))
184+ eventTopics = append (eventTopics , convert [string ](convert [map [string ]any ](topic )["name" ]))
186185 }
187186
188- return types , audiences , topics
187+ return eventTypes , targetAudiences , eventTopics
189188}
190189
191190// getDepartmentsAndTags parses the departments, and tags
0 commit comments