From b31ef35ccc827d745cc5a2c65e5554242812ed45 Mon Sep 17 00:00:00 2001 From: Felipe Coury Date: Fri, 21 Jun 2013 02:55:20 -0300 Subject: [PATCH] added go test app --- tests/go/.godir | 1 + tests/go/Procfile | 1 + tests/go/web.go | 20 ++++++++++++++++++++ 3 files changed, 22 insertions(+) create mode 100644 tests/go/.godir create mode 100644 tests/go/Procfile create mode 100644 tests/go/web.go diff --git a/tests/go/.godir b/tests/go/.godir new file mode 100644 index 000000000..4023f2095 --- /dev/null +++ b/tests/go/.godir @@ -0,0 +1 @@ +go diff --git a/tests/go/Procfile b/tests/go/Procfile new file mode 100644 index 000000000..4890262c0 --- /dev/null +++ b/tests/go/Procfile @@ -0,0 +1 @@ +web: go diff --git a/tests/go/web.go b/tests/go/web.go new file mode 100644 index 000000000..a51f5db43 --- /dev/null +++ b/tests/go/web.go @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "net/http" + "os" +) + +func main() { + http.HandleFunc("/", hello) + fmt.Println("listening...") + err := http.ListenAndServe(":"+os.Getenv("PORT"), nil) + if err != nil { + panic(err) + } +} + +func hello(res http.ResponseWriter, req *http.Request) { + fmt.Fprintln(res, "hello, world") +}