Embed presentation
Download to read offline

![TEST.GO
package main
import (
"fmt"
"net/http"
)
func handler(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Hi there, I love %s!", r.URL.Path[1:])
}
func main() {
http.HandleFunc("/", handler)
http.ListenAndServe(":8080", nil)
}](https://image.slidesharecdn.com/golanguage-160201011212/85/Go-Language-by-Google-2-320.jpg)

This document shows how to write a simple web application in Go that returns a greeting containing the request path. It defines a handler function that writes "Hi there, I love %s!" to the response, with the request path inserted. It then compiles and runs the program, serving requests on port 8080.

![TEST.GO
package main
import (
"fmt"
"net/http"
)
func handler(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Hi there, I love %s!", r.URL.Path[1:])
}
func main() {
http.HandleFunc("/", handler)
http.ListenAndServe(":8080", nil)
}](https://image.slidesharecdn.com/golanguage-160201011212/85/Go-Language-by-Google-2-320.jpg)
