127.0.0.1:8080/task/operating?id=618588721544957952&option=3

16239241528073

Comment From: thinkgos

GetInt64() is you set that you store a new key/value pair exclusively for this context, not from query or param. cast is easy casting from one type to another type when you get a string from query.

Comment From: myml

You can use ShouldBindQuery.

func Operating(c *gin.Context) {
    var query struct {
        Option int64 `form:"option"`
    }
    c.ShouldBindQuery(&query)
    log.Println(query.Option)
}