Picking up the go tour again

after a (very) brief interlude with D.  Le sigh.
This commit is contained in:
Dan Buch 2012-10-18 09:17:47 -04:00
parent 49612a9881
commit d9a4c3a2e7
2 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,9 @@
package main
import (
"net/http"
)
func main() {
http.ListenAndServe("localhost:4000", nil)
}

19
gotime/src/hello-web.go Normal file
View File

@ -0,0 +1,19 @@
package main
import (
"fmt"
"net/http"
)
type Hello struct{}
func (h Hello) ServeHTTP(
w http.ResponseWriter,
r *http.Request) {
fmt.Fprint(w, "Hello!\n")
}
func main() {
var h Hello
http.ListenAndServe("localhost:4000", h)
}