Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

int转string #7

Open
OpenCreate opened this issue Oct 17, 2021 · 0 comments
Open

int转string #7

OpenCreate opened this issue Oct 17, 2021 · 0 comments

Comments

@OpenCreate
Copy link

context.SetCookie("user_cookie", string(u.Id), 1000, "/", "localhost", false, true)

这里如果是将整数直接转为字符串显示,应该考虑使用 strconv.FormatInt((int64(u.Id))
string(u.Id) 将生成一个rune 值为 u.Id 值的字符串。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant