Skip to content

Instantly share code, notes, and snippets.

@hayunjong83
Created January 9, 2020 12:26
Show Gist options
  • Save hayunjong83/4cba254b79ea645c66e7a9d5b62a9700 to your computer and use it in GitHub Desktop.
Save hayunjong83/4cba254b79ea645c66e7a9d5b62a9700 to your computer and use it in GitHub Desktop.
hello world go web application
package main
import (
"fmt"
"net/http"
)
func handler(writer http.ResponseWriter, request *http.Request) {
fmt.Fprintf(writer, "Hello Go World, %s!", request.URL.Path[1:])
}
func main(){
http.HandleFunc("/", handler)
http.ListenAndServe(":8080", nil)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment