Created
May 29, 2017 22:20
-
-
Save Adron/59af8efc98e82dc82fd6d4b8f8652fd3 to your computer and use it in GitHub Desktop.
Go Hello World style app that does some actual processing.
This file contains hidden or 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 ( | |
| "bytes" | |
| "fmt" | |
| "log" | |
| "net/http" | |
| ) | |
| func main() { | |
| http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { | |
| var buffer bytes.Buffer | |
| for i := 0; i < 1000; i++ { | |
| buffer.WriteString("a") | |
| } | |
| fmt.Fprintf(w, buffer.String()+"Hello!") | |
| }) | |
| log.Println("Listening on 8080...") | |
| log.Fatal(http.ListenAndServe(":8080", nil)) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment