1 // Copyright 2012 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
14 func (httpPkg
) Get(url
string) {}
18 // This example fetches several URLs concurrently,
19 // using a WaitGroup to block until all the fetches are complete.
20 func ExampleWaitGroup() {
23 "http://www.golang.org/",
24 "http://www.google.com/",
25 "http://www.example.com/",
27 for _
, url
:= range urls
{
28 // Increment the WaitGroup counter.
30 // Launch a goroutine to fetch the URL.
32 // Decrement the counter when the goroutine completes.
38 // Wait for all HTTP fetches to complete.
45 fmt
.Println("Only once")
47 done
:= make(chan bool)
48 for i
:= 0; i
< 10; i
++ {
54 for i
:= 0; i
< 10; i
++ {