chore: add some annotations (#1544)

ref: #1075 
because I am not a native English, maybe have a bit problem.
This commit is contained in:
田欧
2018-09-15 10:23:32 +08:00
committed by Bo-Yi Wu
parent 3f27866f80
commit d510595aa5
21 changed files with 97 additions and 16 deletions

View File

@ -6,7 +6,7 @@ import (
"github.com/gin-gonic/gin"
)
var DB = make(map[string]string)
var db = make(map[string]string)
func setupRouter() *gin.Engine {
// Disable Console Color
@ -21,7 +21,7 @@ func setupRouter() *gin.Engine {
// Get user value
r.GET("/user/:name", func(c *gin.Context) {
user := c.Params.ByName("name")
value, ok := DB[user]
value, ok := db[user]
if ok {
c.JSON(http.StatusOK, gin.H{"user": user, "value": value})
} else {
@ -50,7 +50,7 @@ func setupRouter() *gin.Engine {
}
if c.Bind(&json) == nil {
DB[user] = json.Value
db[user] = json.Value
c.JSON(http.StatusOK, gin.H{"status": "ok"})
}
})