Last active
July 1, 2023 10:00
-
-
Save j178/a669204b9bf943ad7cca5889daa9a574 to your computer and use it in GitHub Desktop.
Gin route confliction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "github.com/gin-gonic/gin" | |
func main() { | |
r := gin.Default() | |
r.GET("/users/:name", func(c *gin.Context) {}) | |
// can't use `:id` here, change to `:name` will fix the confliction | |
r.GET("/users/:id/repos", func(c *gin.Context) {}) | |
_ = r.Run(":8080") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
echo:
chi: