From 1dc263bf2b01606ad1d7f87f55f5da6c30eb9fbe Mon Sep 17 00:00:00 2001 From: Dale Hui Date: Sun, 25 Aug 2024 17:29:12 -0700 Subject: [PATCH 1/3] Use newer math/rand/v2 --- testing/docker.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/testing/docker.go b/testing/docker.go index 2a7c57f98..d418f3568 100644 --- a/testing/docker.go +++ b/testing/docker.go @@ -15,11 +15,10 @@ import ( dockerclient "github.com/docker/docker/client" "github.com/hashicorp/go-multierror" "io" - "math/rand" + "math/rand/v2" "strconv" "strings" "testing" - "time" ) func NewDockerContainer(t testing.TB, image string, env []string, cmd []string) (*DockerContainer, error) { @@ -286,15 +285,11 @@ type dockerImagePullOutput struct { Progress string `json:"progress"` } -func init() { - rand.Seed(time.Now().UnixNano()) -} - func pseudoRandStr(n int) string { var letterRunes = []rune("abcdefghijklmnopqrstuvwxyz0123456789") b := make([]rune, n) for i := range b { - b[i] = letterRunes[rand.Intn(len(letterRunes))] + b[i] = letterRunes[rand.IntN(len(letterRunes))] } return string(b) } From 3c9854113deff13aafb5854cdd89382c95fdf128 Mon Sep 17 00:00:00 2001 From: Dale Hui Date: Sun, 25 Aug 2024 17:13:37 -0700 Subject: [PATCH 2/3] Update with currently supported postgres versions --- database/pgx/pgx_test.go | 5 +---- database/pgx/v5/pgx_test.go | 5 +---- database/postgres/postgres_test.go | 8 ++++---- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/database/pgx/pgx_test.go b/database/pgx/pgx_test.go index 53e8e1d86..03977973d 100644 --- a/database/pgx/pgx_test.go +++ b/database/pgx/pgx_test.go @@ -34,14 +34,11 @@ var ( PortRequired: true, ReadyFunc: isReady} // Supported versions: https://www.postgresql.org/support/versioning/ specs = []dktesting.ContainerSpec{ - {ImageName: "postgres:9.5", Options: opts}, - {ImageName: "postgres:9.6", Options: opts}, - {ImageName: "postgres:10", Options: opts}, - {ImageName: "postgres:11", Options: opts}, {ImageName: "postgres:12", Options: opts}, {ImageName: "postgres:13", Options: opts}, {ImageName: "postgres:14", Options: opts}, {ImageName: "postgres:15", Options: opts}, + {ImageName: "postgres:16", Options: opts}, } ) diff --git a/database/pgx/v5/pgx_test.go b/database/pgx/v5/pgx_test.go index c7339c4fc..3066376b9 100644 --- a/database/pgx/v5/pgx_test.go +++ b/database/pgx/v5/pgx_test.go @@ -35,14 +35,11 @@ var ( PortRequired: true, ReadyFunc: isReady} // Supported versions: https://www.postgresql.org/support/versioning/ specs = []dktesting.ContainerSpec{ - {ImageName: "postgres:9.5", Options: opts}, - {ImageName: "postgres:9.6", Options: opts}, - {ImageName: "postgres:10", Options: opts}, - {ImageName: "postgres:11", Options: opts}, {ImageName: "postgres:12", Options: opts}, {ImageName: "postgres:13", Options: opts}, {ImageName: "postgres:14", Options: opts}, {ImageName: "postgres:15", Options: opts}, + {ImageName: "postgres:16", Options: opts}, } ) diff --git a/database/postgres/postgres_test.go b/database/postgres/postgres_test.go index 02bf991b8..988d086b2 100644 --- a/database/postgres/postgres_test.go +++ b/database/postgres/postgres_test.go @@ -35,11 +35,11 @@ var ( PortRequired: true, ReadyFunc: isReady} // Supported versions: https://www.postgresql.org/support/versioning/ specs = []dktesting.ContainerSpec{ - {ImageName: "postgres:9.5", Options: opts}, - {ImageName: "postgres:9.6", Options: opts}, - {ImageName: "postgres:10", Options: opts}, - {ImageName: "postgres:11", Options: opts}, {ImageName: "postgres:12", Options: opts}, + {ImageName: "postgres:13", Options: opts}, + {ImageName: "postgres:14", Options: opts}, + {ImageName: "postgres:15", Options: opts}, + {ImageName: "postgres:16", Options: opts}, } ) From d273136ea03b52e1c3d868a7c12b4c7d4818f098 Mon Sep 17 00:00:00 2001 From: Dale Hui Date: Sun, 25 Aug 2024 20:34:48 -0700 Subject: [PATCH 3/3] Update to Go 1.23 and drop support for Go 1.21 --- .github/workflows/ci.yaml | 6 +++--- README.md | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c339251cf..4068f086f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -11,7 +11,7 @@ jobs: steps: - uses: actions/setup-go@v5 with: - go-version: "1.22.x" + go-version: "1.23.x" - uses: actions/checkout@v4 - name: golangci-lint uses: golangci/golangci-lint-action@v4 @@ -22,7 +22,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go: ["1.21.x", "1.22.x"] + go: ["1.22.x", "1.23.x"] steps: - uses: actions/checkout@v4 @@ -68,7 +68,7 @@ jobs: ruby-version: 2.7 - uses: actions/setup-go@v5 with: - go-version: "1.22.x" + go-version: "1.23.x" - uses: docker/setup-qemu-action@v3 - uses: docker/setup-buildx-action@v3 diff --git a/README.md b/README.md index 975348685..e7b67c31a 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Coverage Status](https://img.shields.io/coveralls/github/golang-migrate/migrate/master.svg)](https://coveralls.io/github/golang-migrate/migrate?branch=master) [![packagecloud.io](https://img.shields.io/badge/deb-packagecloud.io-844fec.svg)](https://packagecloud.io/golang-migrate/migrate?filter=debs) [![Docker Pulls](https://img.shields.io/docker/pulls/migrate/migrate.svg)](https://hub.docker.com/r/migrate/migrate/) -![Supported Go Versions](https://img.shields.io/badge/Go-1.21%2C%201.22-lightgrey.svg) +![Supported Go Versions](https://img.shields.io/badge/Go-1.22%2C%201.23-lightgrey.svg) [![GitHub Release](https://img.shields.io/github/release/golang-migrate/migrate.svg)](https://github.com/golang-migrate/migrate/releases) [![Go Report Card](https://goreportcard.com/badge/github.com/golang-migrate/migrate/v4)](https://goreportcard.com/report/github.com/golang-migrate/migrate/v4)