diff --git a/.github/workflows/code-coverage-upload.yml b/.github/workflows/code-coverage-upload.yml index 09d69ab1..35b76c87 100644 --- a/.github/workflows/code-coverage-upload.yml +++ b/.github/workflows/code-coverage-upload.yml @@ -17,7 +17,7 @@ jobs: - name: Install Go uses: actions/setup-go@v5 with: - go-version: 1.21.x + go-version: 1.22.x - name: Run tests and write coverprofile shell: bash diff --git a/.github/workflows/test-and-build.yml b/.github/workflows/test-and-build.yml index da3e6635..55656359 100644 --- a/.github/workflows/test-and-build.yml +++ b/.github/workflows/test-and-build.yml @@ -22,7 +22,7 @@ jobs: - name: Install Go uses: actions/setup-go@v5 with: - go-version: 1.21.x + go-version: 1.22.x - name: Run tests shell: bash diff --git a/.github/workflows/test-pr.yml b/.github/workflows/test-pr.yml index 7eaeee56..83f800d7 100644 --- a/.github/workflows/test-pr.yml +++ b/.github/workflows/test-pr.yml @@ -6,7 +6,7 @@ jobs: run-tests: strategy: matrix: - go-version: [1.21.x] + go-version: [1.22.x] platform: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.platform }} diff --git a/README.md b/README.md index 791a25ff..70bebda4 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ in running a native Windows container. ## Building / Running Dependencies: - * [go](https://go.dev/doc/install) version 1.21 or later + * [go](https://go.dev/doc/install) version 1.22 or later * [git](https://git-scm.com/) (You can also download a .zip from Github) In order to download and build, open a terminal and execute: @@ -137,4 +137,4 @@ original file. * [Trash Icon](https://www.iconfinder.com/icons/315225/trash_can_icon) - Made by [Yannick Lung](https://yannicklung.com) * [Undo Icon](https://www.iconfinder.com/icons/308948/arrow_undo_icon) - Made by [Ivan Boyko](https://www.iconfinder.com/visualpharm) * [Alarmclock Icon](https://www.iconfinder.com/icons/4280508/alarm_outlined_alert_clock_icon) - Made by [Kit of Parts](https://www.iconfinder.com/kitofparts) -* https://www.iconfinder.com/icons/808399/load_turn_turnaround_icon TODO \ No newline at end of file +* https://www.iconfinder.com/icons/808399/load_turn_turnaround_icon TODO diff --git a/go.mod b/go.mod index 5ec1298b..a4e4d13e 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/scribble-rs/scribble.rs -go 1.21.3 +go 1.22.0 require ( github.com/Bios-Marcel/discordemojimap/v2 v2.0.6-0.20231020161444-8c7f7fa6e5a6 diff --git a/internal/game/lobby.go b/internal/game/lobby.go index 4cdbc012..43716f83 100644 --- a/internal/game/lobby.go +++ b/internal/game/lobby.go @@ -5,7 +5,7 @@ import ( "fmt" "log" "math" - "math/rand" + "math/rand/v2" "sort" "strings" "sync" diff --git a/internal/game/words.go b/internal/game/words.go index 8a558cff..b353bd8c 100644 --- a/internal/game/words.go +++ b/internal/game/words.go @@ -4,7 +4,7 @@ import ( "embed" "errors" "fmt" - "math/rand" + "math/rand/v2" "strings" "unicode/utf8" diff --git a/linux.Dockerfile b/linux.Dockerfile index 3cddf3ea..29dee4a3 100644 --- a/linux.Dockerfile +++ b/linux.Dockerfile @@ -4,7 +4,7 @@ # We explicitly use a certain major version of go, to make sure we don't build # with a newer verison than we are using for CI tests, as we don't directly # test the produced binary but from source code directly. -FROM docker.io/golang:1.21.3 AS builder +FROM docker.io/golang:1.22.0 AS builder WORKDIR /app # This causes caching of the downloaded go modules and makes repeated local diff --git a/tools/simulate/main.go b/tools/simulate/main.go index bd428149..0244364b 100644 --- a/tools/simulate/main.go +++ b/tools/simulate/main.go @@ -6,7 +6,7 @@ import ( "fmt" "io" "log" - "math/rand" + "math/rand/v2" "net/http" "strings" "time" @@ -82,7 +82,6 @@ type SimPlayer struct { Name string Usersession string ws *gws.Conn - rand *rand.Rand } func (s *SimPlayer) WriteJSON(value any) error { @@ -101,9 +100,9 @@ func (s *SimPlayer) SendRandomStroke() { "toX": rand.Float64(), "toY": rand.Float64(), "color": map[string]any{ - "r": rand.Intn(255), - "g": rand.Intn(255), - "b": rand.Intn(255), + "r": rand.Int32N(255), + "g": rand.Int32N(255), + "b": rand.Int32N(255), }, "lineWidth": 5, }); err != nil { @@ -171,7 +170,6 @@ func JoinPlayer(lobbyId string) (*SimPlayer, error) { return &SimPlayer{ Usersession: session, ws: wsConnection, - rand: rand.New(rand.NewSource(time.Now().Unix())), }, nil } diff --git a/windows.Dockerfile b/windows.Dockerfile index dcf4ca79..0668104e 100644 --- a/windows.Dockerfile +++ b/windows.Dockerfile @@ -4,7 +4,7 @@ # We explicitly use a certain major version of go, to make sure we don't build # with a newer verison than we are using for CI tests, as we don't directly # test the produced binary but from source code directly. -FROM docker.io/golang:1.21.3-nanoserver-ltsc2022 AS builder +FROM docker.io/golang:1.22.0-nanoserver-ltsc2022 AS builder WORKDIR /app # This causes caching of the downloaded go modules and makes repeated local