希望可以校验token格式 I hope that the token format can be verified
cccqcccq opened this issue · comments
当遇到token乱传值时使用验证token会直接报错:invalid memory address or nil pointer dereference
例如:当token传值1.1.1时不会报错会提示校验失败,当传值111时候直接报错
When a token is randomly transferred, an error will be reported when the token is used to verify the value:invalid memory address or nil pointer dereference
For example: when the token value is 1.1.1, no error will be reported but a verification failure will be prompted. When the value 111 is passed, an error will be reported directly.
In Go, it's best practice to check the error, and if err != nil
you typically don't trust the other returned values.
I suggest checking the err
in the example above.
In Go, it's best practice to check the error, and
if err != nil
you typically don't trust the other returned values.在 Go 中,最佳做法是检查错误,if err != nil
通常不信任其他返回的值。I suggest checking the
err
in the example above.我建议在上面的例子中检查一下err
。
Please check my latest reply, this file is parser.go in the framework