/programming-with-go-exercise-api

Programming with Go workshop API exercise

Primary LanguageGo

Programming with Go API exercise

Implement the /clock/current http handler as described in the internal/clock/handler.go file:

// CurrentHandler returns a 200 response with the current time in UTC as a Time JSON representation.
// Callers might request a response in the timezone of their location by setting the header WS-Location to a
// location name corresponding to a file in the IANA Time Zone database, such as "America/New_York".
// If an unknown location is received it serves a 400 response.
func CurrentHandler(w http.ResponseWriter, r *http.Request) {
	// TODO
}}

References: