add error check when loading time location
This commit is contained in:
6
main.go
6
main.go
@@ -376,7 +376,11 @@ func main() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
loc, _ := time.LoadLocation("Europe/Moscow")
|
loc, err := time.LoadLocation("Europe/Moscow")
|
||||||
|
if err != nil {
|
||||||
|
http.Error(w, fmt.Sprintf("failed to load time location: %v", err), 500)
|
||||||
|
return
|
||||||
|
}
|
||||||
for _, episode := range episodes {
|
for _, episode := range episodes {
|
||||||
episode.CreatedAt = episode.CreatedAt.In(loc)
|
episode.CreatedAt = episode.CreatedAt.In(loc)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user