cmd/helloserver: print headers more pretty

This commit is contained in:
Cadey Ratio 2017-01-22 09:48:14 -08:00
parent 7c4b336b8e
commit e350d53954
1 changed files with 3 additions and 1 deletions

View File

@ -4,6 +4,8 @@ import (
"flag"
"fmt"
"net/http"
"github.com/kr/pretty"
)
var (
@ -17,5 +19,5 @@ func main() {
func handle(w http.ResponseWriter, r *http.Request) {
fmt.Fprintln(w, "Route is go!")
fmt.Fprintf(w, "%#v\n", r.Header)
fmt.Fprintf(w, "%s\n", pretty.Sprint(r.Header))
}