Why Handler is not reached


(Miha) #1

Hi

why in my case handler is not reached?

http.HandleFunc("/test", TestFunc)
log.Fatal(http.ListenAndServe(":8889", nil))

func TestFunc(w http.ResponseWriter, r *http.Request) {
fmt.Println("test")
}

(Karthick) #2

hello miha,
Can you please post your complete code for better understanding.


(Yamil Bracho) #3

If your are waiting to see “test” in the browser, you have to change your code to

w.Write([]byte("test"))