diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 13187cc..d0550e0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,7 +13,7 @@ jobs: - name: Install Go uses: actions/setup-go@v2 with: - go-version: 1.18.x + go-version: 1.20.x - name: Check out code uses: actions/checkout@v2 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cf48561..c32799f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,7 +7,7 @@ jobs: - name: Install Go uses: actions/setup-go@v2 with: - go-version: 1.18.x + go-version: 1.20.x - name: Check out code uses: actions/checkout@v2 - name: Build diff --git a/main.go b/main.go index 1bafa7e..b79f995 100644 --- a/main.go +++ b/main.go @@ -1,14 +1,15 @@ // Copyright 2014 Team 254. All Rights Reserved. // Author: pat@patfairbank.com (Patrick Fairbank) +// Go version 1.20 or newer is required due to how it initializes the PRNG. +//go:build go1.20 + package main import ( "github.com/Team254/cheesy-arena-lite/field" "github.com/Team254/cheesy-arena-lite/web" "log" - "math/rand" - "time" ) const eventDbPath = "./event.db" @@ -16,8 +17,6 @@ const httpPort = 8080 // Main entry point for the application. func main() { - rand.Seed(time.Now().UnixNano()) - arena, err := field.NewArena(eventDbPath) if err != nil { log.Fatalln("Error during startup: ", err) diff --git a/tournament/qualification_rankings_test.go b/tournament/qualification_rankings_test.go index 35180db..922cf3e 100644 --- a/tournament/qualification_rankings_test.go +++ b/tournament/qualification_rankings_test.go @@ -7,10 +7,12 @@ import ( "github.com/Team254/cheesy-arena-lite/game" "github.com/Team254/cheesy-arena-lite/model" "github.com/stretchr/testify/assert" + "math/rand" "testing" ) func TestCalculateRankings(t *testing.T) { + rand.Seed(1) database := setupTestDb(t) setupMatchResultsForRankings(database)