diff options
author | Andrew Gerrand <adg@golang.org> | 2012-02-27 11:25:43 +1100 |
---|---|---|
committer | Andrew Gerrand <adg@golang.org> | 2012-02-27 11:25:43 +1100 |
commit | cd1a2f7e74b9a697cacfeee971cdba506b032eb2 (patch) | |
tree | 731f0c3d00df3864653c9407b7b36696e1d05d3e /doc/articles/wiki/http-sample.go | |
parent | b49dcb9d37cd5856fe273a0ceb56e70ce03e969f (diff) | |
download | go-git-cd1a2f7e74b9a697cacfeee971cdba506b032eb2.tar.gz |
doc: move wiki tutorial into articles directory, rmdir doc/codelab
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5701050
Diffstat (limited to 'doc/articles/wiki/http-sample.go')
-rw-r--r-- | doc/articles/wiki/http-sample.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/doc/articles/wiki/http-sample.go b/doc/articles/wiki/http-sample.go new file mode 100644 index 0000000000..ac8cc4f2d6 --- /dev/null +++ b/doc/articles/wiki/http-sample.go @@ -0,0 +1,15 @@ +package main + +import ( + "fmt" + "net/http" +) + +func handler(w http.ResponseWriter, r *http.Request) { + fmt.Fprintf(w, "Hi there, I love %s!", r.URL.Path[1:]) +} + +func main() { + http.HandleFunc("/", handler) + http.ListenAndServe(":8080", nil) +} |