Hi,

It works on the playground at least, https://go.dev/play/p/YZbgmezjSIV
Are you sure your server is listening on port 80? That's fairly uncommon 
for service code and usually requires extra permissions.
If it's listening on another port, you'll have to specify that in the 
browser as well (see line 27 in the link above).

Regards,
Per Johansson

On Sunday, June 2, 2024 at 11:26:36 PM UTC+2 rogerjd wrote:

> Routing Enhancements for Go 1.22
>
> I have this in the init func for main 
>     http.HandleFunc("GET /posts", handlePost2)
>
> Yet, in the browser, when http://127.0.0.1/posts is entered, it returns
> 404 page not found.
>
> Am I doing something wrong? Maybe the problem lies elsewhere?
> Thank you,
> Roger
>
> func handlePost2(w http.ResponseWriter, r *http.Request) {
>     fmt.Fprint(w, "GET test handlePost2")
> }
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/79390cb0-bfac-482e-a844-91b7c6326602n%40googlegroups.com.

Reply via email to