redis / rueidis

A fast Golang Redis client that supports Client Side Caching, Auto Pipelining, Generics OM, RedisJSON, RedisBloom, RediSearch, etc.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fix code scanning alert - Incorrect conversion between integer types

rueian opened this issue · comments

@rueian I'm running into a 404 error when trying to access the link. Would you mind filling me in with more details about the issue?

Hi @moonorange, here is the content of the link

image

Hi @proost,

CodeQL found the uint(uint64) conversion issue in 3 lines of rueidisprob.

image

Could we just return uint64 without conversion?

@rueian changing to uint64 is easy, but it is breaking change.
If we care backward-compatibility, we should deprecate old methods and adding new methods. If not, change to uint64.

Yes, it is a breaking change, but I believe it is acceptable since most people don’t explicitly declare its return value as uint. If they don’t do that they will not be break. It they do that they can also easily fix the break.