I'm using Gorilla mux in my golang api for routing. I have two paths that are similar: /users/{id}
and /users/settings
. When I make a call to the /users/settings endpoint, it is getting routed to the endpoint /users/{id}
. How do I fix this?
router := mux.NewRouter()
router.HandleFunc("/users/{id}", usersController.GetUserDetail).Methods(http.MethodGet)
router.HandleFunc("/users/settings", usersController.GetSettings).Methods(http.MethodGet)