Why is the subsequent code not executed after the gin group request is returned?

middle := r.Group("", func(context *gin.Context) {
        requestMethod := context.Request.Method
        token := ""
        fmt.Println("request method===========>", requestMethod)
        if requestMethod == "GET" {
            token = context.DefaultQuery("token", "")
        } else if requestMethod == "POST" {
            token = context.DefaultPostForm("token", "")
        }
        fmt.Println("token================>", token)
        if token == "" {
            context.JSON(http.StatusOK, gin.H{
                "code": statusCode.CODE_TOKEN_EMPTY,
                "msg":  statusCode.GetCodeMsg(statusCode.CODE_TOKEN_EMPTY),
            })
            return
        }
        //redisuid
        redisClient := common.CreateReadRedisClient()
        val, err := redisClient.Get(common.UserLoginPrex + token).Result()
        fmt.Println("user id =============>", val, err)
        if err != nil {
            context.JSON(http.StatusOK, gin.H{
                "code": statusCode.CODE_REDIS_COMMAND_ERR,
                "msg":  statusCode.GetCodeMsg(statusCode.CODE_REDIS_COMMAND_ERR),
            })
            return
        }
        if val == "" {
            context.JSON(http.StatusOK, gin.H{
                "code": statusCode.CODE_TOKEN_INVALID,
                "msg":  statusCode.GetCodeMsg(statusCode.CODE_TOKEN_INVALID),
            })
            return
        } else {
            fmt.Println("uid------------->", val)
            fmt.Println("token------------->", token)
            context.Set("uid", val)
            context.Set("token", token)
        }
    })
    //
    middle.GET("/user/myFans", user.MyFans)

defines a middle, and creates an interface, but if token is empty or token is illegal, I return json information in middle. My understanding is that the json error message is returned in middle, and the subsequent user.MyFans should not be executed, but the actual situation is that this is still executed, resulting in an output like this:

{"code":1001,"msg":""}{"code":0,"data":{"allFansNum":0,"directFans":0,"normalOperatorNum":0,"recommendFans":0,"superOperatorNum":0},"msg":"ok"}

how to deal with the change here, directly output {"code": 1001, "msg": "system error"}, the subsequent code is not executed?

Apr.02,2021

context.Abort ()


if you want to terminate the execution of context.Abort (), context.Next ()

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e598c2-45543.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e598c2-45543.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?