return on error

This commit is contained in:
Naitik Shah 2013-03-25 14:59:40 -07:00
parent 07af98f40b
commit e6c599461d

View File

@ -33,6 +33,7 @@ func newHandler(name string) http.Handler {
duration, err := time.ParseDuration(r.FormValue("duration"))
if err != nil {
http.Error(w, err.Error(), 400)
return
}
time.Sleep(duration)
fmt.Fprintf(