Skip to content

Instantly share code, notes, and snippets.

@nishantmodak
Last active August 29, 2015 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nishantmodak/10011158 to your computer and use it in GitHub Desktop.
Save nishantmodak/10011158 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"net/http"
"time"
)
func main() {
http.HandleFunc("/", handler)
log.Println("listening...")
err := http.ListenAndServe(":8080", nil)
if err != nil {
panic(err)
}
}
func handler(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Hello. The time is : " + time.Now().Format(time.RFC850))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment