demo code smell

This commit is contained in:
Naitik Shah 2013-03-25 14:51:46 -07:00
parent 0109b3fb52
commit 308a01b46b

View File

@ -34,11 +34,13 @@ func newHandler(name string) http.Handler {
http.Error(w, err.Error(), 400) http.Error(w, err.Error(), 400)
} }
time.Sleep(duration) time.Sleep(duration)
w.Write([]byte(fmt.Sprintf( fmt.Fprintf(
w,
"%s started at %s slept for %d nanoseconds.\n", "%s started at %s slept for %d nanoseconds.\n",
name, name,
now, now,
duration.Nanoseconds()))) duration.Nanoseconds(),
)
}) })
return mux return mux
} }