cmd/helloserver: print headers more pretty
This commit is contained in:
parent
7c4b336b8e
commit
e350d53954
|
@ -4,6 +4,8 @@ import (
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/kr/pretty"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -17,5 +19,5 @@ func main() {
|
||||||
|
|
||||||
func handle(w http.ResponseWriter, r *http.Request) {
|
func handle(w http.ResponseWriter, r *http.Request) {
|
||||||
fmt.Fprintln(w, "Route is go!")
|
fmt.Fprintln(w, "Route is go!")
|
||||||
fmt.Fprintf(w, "%#v\n", r.Header)
|
fmt.Fprintf(w, "%s\n", pretty.Sprint(r.Header))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue