Update go to 1.24.0 (#14969)

* Update rules_go to v0.53.0

* Update staticcheck to v0.6.0

* Update to go 1.24.0

* Update github.com/trailofbits/go-mutexasserts to latest

* Use rules_go @ cf3c3af34bd869b864f5f2b98e2f41c2b220d6c9

* Provide the go binary to SszGen. 
https://github.com/bazel-contrib/rules_go/pull/4173

* Unskip SA9003

* Update github ci checks to go1.24.0

* CI: Update gosec to v2.22.1 and golangci to v1..64.5

* Temporarily disable usetesting lint check for go1.24

* gosec: Disable G115 - integer overflow conversion

* gosec: Ignore G407 for "hardcoded" IV. It's not hardcoded.

* Fix uses of rand.Seed. This is a no-op in go1.24 and deprecated since go1.20.

* Changelog fragment
This commit is contained in:
Preston Van Loon
2025-03-05 11:46:39 -06:00
committed by GitHub
parent 417bbf8a9e
commit d46ca97680
13 changed files with 111 additions and 80 deletions

View File

@@ -46,11 +46,11 @@ func Bitlists64WithSingleBitSet(n, length uint64) []*bitfield.Bitlist64 {
func BitlistsWithMultipleBitSet(t testing.TB, n, length, count uint64) []bitfield.Bitlist {
seed := time.Now().UnixNano()
t.Logf("bitlistsWithMultipleBitSet random seed: %v", seed)
rand.Seed(seed)
r := rand.New(rand.NewSource(seed)) // #nosec G404
lists := make([]bitfield.Bitlist, n)
for i := uint64(0); i < n; i++ {
b := bitfield.NewBitlist(length)
keys := rand.Perm(int(length)) // lint:ignore uintcast -- This is safe in test code.
keys := r.Perm(int(length)) // lint:ignore uintcast -- This is safe in test code.
for _, key := range keys[:count] {
b.SetBitAt(uint64(key), true)
}
@@ -63,11 +63,11 @@ func BitlistsWithMultipleBitSet(t testing.TB, n, length, count uint64) []bitfiel
func Bitlists64WithMultipleBitSet(t testing.TB, n, length, count uint64) []*bitfield.Bitlist64 {
seed := time.Now().UnixNano()
t.Logf("Bitlists64WithMultipleBitSet random seed: %v", seed)
rand.Seed(seed)
r := rand.New(rand.NewSource(seed)) // #nosec G404
lists := make([]*bitfield.Bitlist64, n)
for i := uint64(0); i < n; i++ {
b := bitfield.NewBitlist64(length)
keys := rand.Perm(int(length)) // lint:ignore uintcast -- This is safe in test code.
keys := r.Perm(int(length)) // lint:ignore uintcast -- This is safe in test code.
for _, key := range keys[:count] {
b.SetBitAt(uint64(key), true)
}