Gorilla/mux and go 1.20 version

I updated my server to Go 1.20 and immediately I was having an issue with gorilla/mux with the ListenAndServe("59995", handle(router))) function; when I ran my project, the response was “Listen and Serve listen tcp: address tcp/ 59995: unknown port”. I downgraded to the 1.19 version and it worked correctly (without any changes in the code). If anyone has had the same issue and can provide a suggestion on how to fix this error, I would be very grateful.

Hi, are you sure it works on 1.19?

ListenAndServe() accept an “address string” as input; you should pass something like

ListenAndServe(":59995", handle(router))

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