Why Handler is not reached

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")
}

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

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

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

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.