web-platform-tests / wpt.fyi

web-platform-tests dashboard
https://wpt.fyi/
Other
182 stars 88 forks source link

Fix the int conversion warning in linter #3968

Closed KyleJu closed 2 weeks ago

KyleJu commented 2 weeks ago

Fix the int conversion warning in Linter, suggested in https://github.com/securego/gosec/issues/1185#issuecomment-2304307264. Nolint the intended use of int64 to int conversion

past commented 2 weeks ago

According to this comment the latest version of golangci-lint should not have many false positives. Can you try first to update ours and see if the errors are gone?

KyleJu commented 2 weeks ago

According to this comment the latest version of golangci-lint should not have many false positives. Can you try first to update ours and see if the errors are gone?

The false positive case mentioned is an "uint8 -> int" overflow false positive, or "byte to int". In our cases, we are casting int 64 to int 32 intentionally, which doesn't fall into the false positive.

After the upgrade, the linter failed again. Regardless I will update the latest golangci-lint version. Thanks for the comment!