gofmt
This commit is contained in:
parent
5cfec0f2ef
commit
d3b6541945
@ -21,7 +21,7 @@ func tickReader(sem chan struct{}, ticker *time.Ticker, s string) io.Reader {
|
|||||||
fmt.Fprintf(w, "%s with %v\n", s, t)
|
fmt.Fprintf(w, "%s with %v\n", s, t)
|
||||||
default: // try to comment this and then run :)
|
default: // try to comment this and then run :)
|
||||||
}
|
}
|
||||||
<-sem // add a ticket to the semaphore
|
<-sem // add a ticket to the semaphore
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
return r
|
return r
|
||||||
@ -46,7 +46,7 @@ func main() {
|
|||||||
var (
|
var (
|
||||||
wg sync.WaitGroup
|
wg sync.WaitGroup
|
||||||
semaphore = make(
|
semaphore = make(
|
||||||
chan struct{},
|
chan struct{},
|
||||||
1, // only one goroutine can do its thing
|
1, // only one goroutine can do its thing
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user