package unity import ( "github.com/gin-gonic/gin" ) func GetUId(c *gin.Context) int { //mustGet := c.MustGet("user") value, exists := c.Get("user") if exists { users := value.(map[string]interface{}) id := int(users["ID"].(float64)) return id } return 0 }