mirror of
https://github.com/golang/go
synced 2024-11-21 21:44:40 -07:00
doc: use time.Duration in Effective Go.
R=golang-dev, r CC=golang-dev https://golang.org/cl/5841044
This commit is contained in:
parent
e57a6167b6
commit
e5cc09a75d
@ -2357,7 +2357,7 @@ go list.Sort() // run list.Sort in parallel; don't wait for it.
|
|||||||
<p>
|
<p>
|
||||||
A function literal can be handy in a goroutine invocation.
|
A function literal can be handy in a goroutine invocation.
|
||||||
<pre>
|
<pre>
|
||||||
func Announce(message string, delay int64) {
|
func Announce(message string, delay time.Duration) {
|
||||||
go func() {
|
go func() {
|
||||||
time.Sleep(delay)
|
time.Sleep(delay)
|
||||||
fmt.Println(message)
|
fmt.Println(message)
|
||||||
|
Loading…
Reference in New Issue
Block a user