gofmt wat u know about it

This commit is contained in:
Mark McGranaghan
2012-09-23 18:31:33 -07:00
parent f93bdba75c
commit 89f95f2ac5
66 changed files with 729 additions and 678 deletions

View File

@@ -4,29 +4,29 @@
// accross goroutines. Here's an example of waiting
// for another goroutine to finish.
package main
import "fmt"
package main
import "fmt"
import "time"
// The `done` channel will be used for
// synchronization.
func worker(done chan<- bool) {
fmt.Print("Working...")
func worker(done chan<- bool) {
fmt.Print("Working...")
time.Sleep(time.Second)
fmt.Println(" done")
// Send a value to notify that the work is done.
done <- true
done <- true
}
func main() {
// Start a worker goroutine, give it the channel to
// notify on.
done := make(chan bool, 1)
go worker(done)
done := make(chan bool, 1)
go worker(done)
// Block until we can receive a value from the worker
// over the channel.
<- done
}
<-done
}