-
-
Save aalemayhu/8847732c1747b0cf1fb5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://go.googlecode.com/hg-history/release-branch.r60/doc/GoCourseDay1.pdf | |
package main | |
import ( | |
"fmt" | |
"log" | |
"os/exec" | |
"strconv" | |
s "strings" | |
) | |
func main() { | |
fmt.Println("Downloading pdfs") | |
url_pattern := "http://go.googlecode.com/hg-history/release-branch.r60/doc/GoCourseDay$1.pdf" | |
for i := 1; i < 4; i++ { | |
number := strconv.Itoa(i) | |
download_url := s.Replace(url_pattern, "$1", number, -1) | |
log.Printf("starting with %s", download_url) | |
cmd := exec.Command("wget", download_url) | |
err := cmd.Start() | |
if err != nil { | |
log.Fatal(err) | |
} | |
err = cmd.Wait() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment