go中gin框架+realize实现边写代码边编译,热更新
最近看到了热加载,相关的,就搜索了goland实现热加载 发现了一个插件realize https://github.com/oxequa/realize 然后,为了自己撸代码更方便,配合gin写个教程 1.准备 go get github.com/oxequa/realize go get github.com/gin-gonic/gin 2.然后开始 package main import ( "github.com/gin-gonic/gin" "net/http" ) func main() { r := gin.Default() r.GET("/sayHello/:name", SayHello) r.GET("/test/:id/:name", getUser) r.Run(":9090") } //http://localhost:9090/test/1/dong func getUser(c *gin.Context) { id := c.Param("id") name := c.Param("name") json := gin.H{ "data": id, "name": name, } c.JSON(http.StatusOK, json) } //http://localhost:9090/sayHello/dong func SayHello(c