Skip to content

Instantly share code, notes, and snippets.

@hyuki
Created April 9, 2018 12:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hyuki/c12d47dfd74a6451d8ce5eb836b50c6c to your computer and use it in GitHub Desktop.
Save hyuki/c12d47dfd74a6451d8ce5eb836b50c6c to your computer and use it in GitHub Desktop.
URL http://www.hyuki.com/ の内容をwgetで取得してoutput.htmlというファイルに落とす。
package main
import (
"os/exec"
"fmt"
"log"
)
func main() {
remote_name := "http://www.hyuki.com/"
local_name := "output.html"
err := exec.Command("wget", "-q", remote_name, "-O", local_name).Run()
if err != nil {
log.Fatal(err)
}
fmt.Printf("Open %s\n", local_name)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment