diff options
author | synergydev <synergye@codefi.re> | 2013-10-17 18:16:42 -0700 |
---|---|---|
committer | synergydev <synergye@codefi.re> | 2013-10-17 18:16:42 -0700 |
commit | 61c0330cc243abf13fdd01f377a7f80bd3989eb1 (patch) | |
tree | 119b08ae76294f23e2b1b7e72ff9a06afa9e8509 /gcc-4.8/libgo/go/sync/example_test.go | |
parent | 1c712bf7621f3859c33fd3afaa61fdcaf3fdfd76 (diff) | |
download | toolchain_gcc-61c0330cc243abf13fdd01f377a7f80bd3989eb1.tar.gz toolchain_gcc-61c0330cc243abf13fdd01f377a7f80bd3989eb1.tar.bz2 toolchain_gcc-61c0330cc243abf13fdd01f377a7f80bd3989eb1.zip |
[4.8] Merge GCC 4.8.2
Change-Id: I0f1fcf69c5076d8534c5c45562745e1a37adb197
Diffstat (limited to 'gcc-4.8/libgo/go/sync/example_test.go')
-rw-r--r-- | gcc-4.8/libgo/go/sync/example_test.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc-4.8/libgo/go/sync/example_test.go b/gcc-4.8/libgo/go/sync/example_test.go index 156492400..031c87f03 100644 --- a/gcc-4.8/libgo/go/sync/example_test.go +++ b/gcc-4.8/libgo/go/sync/example_test.go @@ -24,10 +24,10 @@ func ExampleWaitGroup() { wg.Add(1) // Launch a goroutine to fetch the URL. go func(url string) { + // Decrement the counter when the goroutine completes. + defer wg.Done() // Fetch the URL. http.Get(url) - // Decrement the counter. - wg.Done() }(url) } // Wait for all HTTP fetches to complete. @@ -37,7 +37,7 @@ func ExampleWaitGroup() { func ExampleOnce() { var once sync.Once onceBody := func() { - fmt.Printf("Only once\n") + fmt.Println("Only once") } done := make(chan bool) for i := 0; i < 10; i++ { |