2016-02-15から1日間の記事一覧
続き。routetest.go package main import ( "fmt" "log" "net/http" ) func hello(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello World!") } func main() { http.HandleFunc("/", hello) err := http.ListenAndServe(":9090", nil) if e…
続き。before hello.go package main import "fmt" func main() { fmt.Printf("hello, world\n") } hello.goがあるフォルダで。 $ go fmtafter hello.go package main import "fmt" func main() { fmt.Printf("hello, world\n") } コードが整形される。以上…
goのインストール Downloads - The Go Programming Language hello.go実行するとこまで $ export GOPATH=$HOME/work $ vi .profile $ export GOPATH=$HOME/work $ mkdir $HOME/work $ cd HOME/work vi hello.go package mainimport "fmt" // 入出力フォーマ…