demo code smell
This commit is contained in:
parent
0109b3fb52
commit
308a01b46b
@ -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
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user