소스 검색

Fixed some more code in the readme file

There were some more errors in the code snippets
Skuli Oskarsson 11 년 전
부모
커밋
a660a6eb6e
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      README.md

+ 3 - 3
README.md

@@ -23,7 +23,7 @@ import "github.com/gin-gonic/gin"
 
 func main() {
     r := gin.Default()
-    r.GET("ping", func(c *gin.Context){
+    r.GET("/ping", func(c *gin.Context){
         c.String(200, "pong")
     })
     
@@ -207,7 +207,7 @@ Using LoadHTMLTemplates()
 func main() {
     r := gin.Default()
     r.LoadHTMLTemplates("templates/*")
-    r.GET("index", func(c *gin.Context) {
+    r.GET("/index", func(c *gin.Context) {
         obj := gin.H{"title": "Main website"}
         c.HTML(200, "index.tmpl", obj)
     })
@@ -250,7 +250,7 @@ func main() {
     r := gin.New()
     r.Use(Logger())
     
-    r.GET("test", func(c *gin.Context){
+    r.GET("/test", func(c *gin.Context){
         example := r.Get("example").(string)
         
         // it would print: "12345"