Skip to content

Instantly share code, notes, and snippets.

@robinglen
Created September 13, 2018 11:48
Show Gist options
  • Save robinglen/b8d37cb07a699ee140e5d2a2e4e99dfd to your computer and use it in GitHub Desktop.
Save robinglen/b8d37cb07a699ee140e5d2a2e4e99dfd to your computer and use it in GitHub Desktop.
Simple hello world in Go for Medium post
package main
import (
"fmt"
"log"
"net/http"
)
func main() {
http.HandleFunc("/", func(res http.ResponseWriter, req *http.Request) {
fmt.Fprint(res, "Hello World")
})
log.Println("Go Hello World listening on port 8123")
http.ListenAndServe(":8123", nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment