Last active
December 30, 2015 20:29
-
-
Save mwerner/7881370 to your computer and use it in GitHub Desktop.
Hello Go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"log" | |
"net/http" | |
) | |
const listenAddr = "localhost:4000" | |
func main() { | |
http.HandleFunc("/", handler) | |
err := http.ListenAndServe(listenAddr, nil) | |
if err != nil { | |
log.Fatal(err) | |
} | |
} | |
func handler(w http.ResponseWriter, r *http.Request){ | |
fmt.Fprint(w, "Hello, web") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment