I don’t know if gorilla/mux is the most used in RESTful API programming but is a very good choice. Github stars can be a barometer for popularity but you must try it to see if fit your needs.
In my opinion gorilla/mux is fine if you do not build anything large (but even in such case u can still use it).
For a little bit bigger project I would suggest to use gin-gonic/gin. What convinced me to use gin is the possibility to
group routes by version for example: https://github.com/gin-gonic/gin#grouping-routes
Ahh you are right. I did not spot that when I was evaluating Gorilla.
Indeed we can write something like this:
r := mux.NewRouter()
post := r.PathPrefix("/posts/{id}").Subrouter()
post.Methods("GET").Path("/edit").HandlerFunc(PostEditHandler)
post.Methods("GET").HandlerFunc(PostShowHandler)
post.Methods("POST").HandlerFunc(PostUpdateHandler)