chore: add some annotations (#1544)
ref: #1075 because I am not a native English, maybe have a bit problem.
This commit is contained in:
@ -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"})
|
||||
}
|
||||
})
|
||||
|
Reference in New Issue
Block a user