Skip to content

Commit

Permalink
Bump minimum Go version to v1.22, rework CI matrix (#667)
Browse files Browse the repository at this point in the history
* make tidy

* run CI with the 4 most recent Postgres versions (v17, v16, v15, v14)
  against with the latest Go version (v1.23), and run the previous Go
  release (v1.22) against the newest Postgres version.

* use Go v1.22 or higher

* fix update-mod-go tests

* rework CI matrix to run 4 PG versions on latest Go, plus one prior Go release w/ latest PG
  • Loading branch information
bgentry authored Nov 5, 2024
1 parent a34a5c2 commit cef2245
Show file tree
Hide file tree
Showing 17 changed files with 72 additions and 69 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,14 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
# Run the 4 latest Postgres versions against the latest Go version:
go-version:
- "1.21"
- "1.22"
- "1.23"
postgres-version: [14, 15, 16]
postgres-version: [14, 15, 16, 17]
include:
# Also run previous Go version against the latest Postgres version:
- go-version: "1.22"
postgres-version: 17
fail-fast: false
timeout-minutes: 5

Expand Down
2 changes: 1 addition & 1 deletion cmd/river/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/riverqueue/river/cmd/river

go 1.21
go 1.22

toolchain go1.23.0

Expand Down
24 changes: 12 additions & 12 deletions cmd/river/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ github.com/lmittmann/tint v1.0.4 h1:LeYihpJ9hyGvE0w+K2okPTGUdVLfng1+nDNVR4vWISc=
github.com/lmittmann/tint v1.0.4/go.mod h1:HIS3gSy7qNwGCj+5oRjAutErFBl4BzdQP6cJZ0NfMwE=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/riverqueue/river v0.14.0 h1:y3Ni9hRdnlgKTm/h13aKf9rBYWppm/yV0bM04lHO6qo=
github.com/riverqueue/river v0.14.0/go.mod h1:R98qxNGrFOm1rtapS76Ef6y2WbQ56jtOc2kuVSKW/zA=
github.com/riverqueue/river/riverdriver v0.14.0 h1:H0b26b6DslyrJotLtZW603CMAmkbygBi3FlHtgTwbqc=
github.com/riverqueue/river/riverdriver v0.14.0/go.mod h1:DUayJJgiCWwfnsLC3sLBuM/N1cRh2lEoAohV6bHeaiA=
github.com/riverqueue/river/riverdriver/riverdatabasesql v0.14.0 h1:PSrJuff4jzbYD8IKR8QrdyYofdE1vx6t61+lYoIwMrI=
github.com/riverqueue/river/riverdriver/riverdatabasesql v0.14.0/go.mod h1:G6ymkGCy+H6SmRUTSBC9uXnk+dy4TttkuM5L1yS/KDA=
github.com/riverqueue/river/riverdriver/riverpgxv5 v0.14.0 h1:26d1SEOj9lc/owC4ZfLATOw5NRJhFPNSdEisH5FXkr4=
github.com/riverqueue/river/riverdriver/riverpgxv5 v0.14.0/go.mod h1:VlHbD3GF4ioT52J2S2VM2cFHbuG8D9u1bIbT4R/JuPE=
github.com/riverqueue/river/rivershared v0.14.0 h1:XFyHB7ubPOMfWXcT1ZMlyHvnF7fYgsy3QeAwm6wTj3Y=
github.com/riverqueue/river/rivershared v0.14.0/go.mod h1:CWFseAE5WKSQIE3VxVeKGbRKwAVuDEUGIOGkmJwoYdU=
github.com/riverqueue/river/rivertype v0.14.0 h1:VNlnmp8pMEkfgoLROf6oJxdyh5D7Y8XDEAbJH36xf5Q=
github.com/riverqueue/river/rivertype v0.14.0/go.mod h1:wVOhGBeay6+JcIi0pTFlF4KtUgHYFkhMYv8dpxU46W0=
github.com/riverqueue/river v0.14.1 h1:t9DIYRcjyRH5hMJx/ecB7TTOySIg+CKWAinB1wOXPFU=
github.com/riverqueue/river v0.14.1/go.mod h1:3cQREff7+iGZC+u2lire03SOxUmT41bjzpqZWAWPXtk=
github.com/riverqueue/river/riverdriver v0.14.1 h1:gf8s2v97DKY12i7nvXqBM/ljHOGbkW2dLVmHvxyyegA=
github.com/riverqueue/river/riverdriver v0.14.1/go.mod h1:bJDNRwDNiCyXv3ZEfOGUvGBEo6C3fNnPc4VQRF1P+Ys=
github.com/riverqueue/river/riverdriver/riverdatabasesql v0.14.1 h1:HE8NK0JQ+GpFsZaJZKSxmWeb15WsfUaAzpNx/eDXbvc=
github.com/riverqueue/river/riverdriver/riverdatabasesql v0.14.1/go.mod h1:C+A3pzwxMwyclSwfeTRyWoDRoFd9BhNmsSPSe8bv4l8=
github.com/riverqueue/river/riverdriver/riverpgxv5 v0.14.1 h1:iViK0mabHYm5yUP9peG7wek8YQ9nVbOHhaR1P411mSU=
github.com/riverqueue/river/riverdriver/riverpgxv5 v0.14.1/go.mod h1:P9rfgq0hgRM19ty6CHMQTAKUq3crmP28f4BINDfRCyw=
github.com/riverqueue/river/rivershared v0.14.1 h1:lixOqzW20A4f5ubfyl1Gp6TJuSEqYQ2J0UrhB2B12LE=
github.com/riverqueue/river/rivershared v0.14.1/go.mod h1:322qBNl96TTNBdyJ2UNoOfABpvmMAkz4hvnuID1mBs0=
github.com/riverqueue/river/rivertype v0.14.1 h1:f90SKNnmHgePjaxB82ZFi3rkXyVIbOJHSYZ3m6n1UUk=
github.com/riverqueue/river/rivertype v0.14.1/go.mod h1:wVOhGBeay6+JcIi0pTFlF4KtUgHYFkhMYv8dpxU46W0=
github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs=
github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro=
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/riverqueue/river

go 1.21
go 1.22

toolchain go1.23.0

Expand Down
16 changes: 8 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/riverqueue/river/riverdriver v0.14.0 h1:H0b26b6DslyrJotLtZW603CMAmkbygBi3FlHtgTwbqc=
github.com/riverqueue/river/riverdriver v0.14.0/go.mod h1:DUayJJgiCWwfnsLC3sLBuM/N1cRh2lEoAohV6bHeaiA=
github.com/riverqueue/river/riverdriver/riverdatabasesql v0.14.0 h1:PSrJuff4jzbYD8IKR8QrdyYofdE1vx6t61+lYoIwMrI=
github.com/riverqueue/river/riverdriver/riverdatabasesql v0.14.0/go.mod h1:G6ymkGCy+H6SmRUTSBC9uXnk+dy4TttkuM5L1yS/KDA=
github.com/riverqueue/river/riverdriver/riverpgxv5 v0.14.0 h1:26d1SEOj9lc/owC4ZfLATOw5NRJhFPNSdEisH5FXkr4=
github.com/riverqueue/river/riverdriver/riverpgxv5 v0.14.0/go.mod h1:VlHbD3GF4ioT52J2S2VM2cFHbuG8D9u1bIbT4R/JuPE=
github.com/riverqueue/river/rivertype v0.14.0 h1:VNlnmp8pMEkfgoLROf6oJxdyh5D7Y8XDEAbJH36xf5Q=
github.com/riverqueue/river/rivertype v0.14.0/go.mod h1:wVOhGBeay6+JcIi0pTFlF4KtUgHYFkhMYv8dpxU46W0=
github.com/riverqueue/river/riverdriver v0.14.1 h1:gf8s2v97DKY12i7nvXqBM/ljHOGbkW2dLVmHvxyyegA=
github.com/riverqueue/river/riverdriver v0.14.1/go.mod h1:bJDNRwDNiCyXv3ZEfOGUvGBEo6C3fNnPc4VQRF1P+Ys=
github.com/riverqueue/river/riverdriver/riverdatabasesql v0.14.1 h1:HE8NK0JQ+GpFsZaJZKSxmWeb15WsfUaAzpNx/eDXbvc=
github.com/riverqueue/river/riverdriver/riverdatabasesql v0.14.1/go.mod h1:C+A3pzwxMwyclSwfeTRyWoDRoFd9BhNmsSPSe8bv4l8=
github.com/riverqueue/river/riverdriver/riverpgxv5 v0.14.1 h1:iViK0mabHYm5yUP9peG7wek8YQ9nVbOHhaR1P411mSU=
github.com/riverqueue/river/riverdriver/riverpgxv5 v0.14.1/go.mod h1:P9rfgq0hgRM19ty6CHMQTAKUq3crmP28f4BINDfRCyw=
github.com/riverqueue/river/rivertype v0.14.1 h1:f90SKNnmHgePjaxB82ZFi3rkXyVIbOJHSYZ3m6n1UUk=
github.com/riverqueue/river/rivertype v0.14.1/go.mod h1:wVOhGBeay6+JcIi0pTFlF4KtUgHYFkhMYv8dpxU46W0=
github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs=
github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro=
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
Expand Down
2 changes: 1 addition & 1 deletion go.work
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
go 1.21
go 1.22

toolchain go1.23.0

Expand Down
2 changes: 1 addition & 1 deletion riverdriver/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/riverqueue/river/riverdriver

go 1.21
go 1.22

toolchain go1.23.0

Expand Down
4 changes: 2 additions & 2 deletions riverdriver/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/riverqueue/river/rivertype v0.14.0 h1:VNlnmp8pMEkfgoLROf6oJxdyh5D7Y8XDEAbJH36xf5Q=
github.com/riverqueue/river/rivertype v0.14.0/go.mod h1:wVOhGBeay6+JcIi0pTFlF4KtUgHYFkhMYv8dpxU46W0=
github.com/riverqueue/river/rivertype v0.14.1 h1:f90SKNnmHgePjaxB82ZFi3rkXyVIbOJHSYZ3m6n1UUk=
github.com/riverqueue/river/rivertype v0.14.1/go.mod h1:wVOhGBeay6+JcIi0pTFlF4KtUgHYFkhMYv8dpxU46W0=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
Expand Down
2 changes: 1 addition & 1 deletion riverdriver/riverdatabasesql/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/riverqueue/river/riverdriver/riverdatabasesql

go 1.21
go 1.22

toolchain go1.23.0

Expand Down
16 changes: 8 additions & 8 deletions riverdriver/riverdatabasesql/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/riverqueue/river v0.14.0 h1:y3Ni9hRdnlgKTm/h13aKf9rBYWppm/yV0bM04lHO6qo=
github.com/riverqueue/river v0.14.0/go.mod h1:R98qxNGrFOm1rtapS76Ef6y2WbQ56jtOc2kuVSKW/zA=
github.com/riverqueue/river/riverdriver v0.14.0 h1:H0b26b6DslyrJotLtZW603CMAmkbygBi3FlHtgTwbqc=
github.com/riverqueue/river/riverdriver v0.14.0/go.mod h1:DUayJJgiCWwfnsLC3sLBuM/N1cRh2lEoAohV6bHeaiA=
github.com/riverqueue/river/rivershared v0.14.0 h1:XFyHB7ubPOMfWXcT1ZMlyHvnF7fYgsy3QeAwm6wTj3Y=
github.com/riverqueue/river/rivershared v0.14.0/go.mod h1:CWFseAE5WKSQIE3VxVeKGbRKwAVuDEUGIOGkmJwoYdU=
github.com/riverqueue/river/rivertype v0.14.0 h1:VNlnmp8pMEkfgoLROf6oJxdyh5D7Y8XDEAbJH36xf5Q=
github.com/riverqueue/river/rivertype v0.14.0/go.mod h1:wVOhGBeay6+JcIi0pTFlF4KtUgHYFkhMYv8dpxU46W0=
github.com/riverqueue/river v0.14.1 h1:t9DIYRcjyRH5hMJx/ecB7TTOySIg+CKWAinB1wOXPFU=
github.com/riverqueue/river v0.14.1/go.mod h1:3cQREff7+iGZC+u2lire03SOxUmT41bjzpqZWAWPXtk=
github.com/riverqueue/river/riverdriver v0.14.1 h1:gf8s2v97DKY12i7nvXqBM/ljHOGbkW2dLVmHvxyyegA=
github.com/riverqueue/river/riverdriver v0.14.1/go.mod h1:bJDNRwDNiCyXv3ZEfOGUvGBEo6C3fNnPc4VQRF1P+Ys=
github.com/riverqueue/river/rivershared v0.14.1 h1:lixOqzW20A4f5ubfyl1Gp6TJuSEqYQ2J0UrhB2B12LE=
github.com/riverqueue/river/rivershared v0.14.1/go.mod h1:322qBNl96TTNBdyJ2UNoOfABpvmMAkz4hvnuID1mBs0=
github.com/riverqueue/river/rivertype v0.14.1 h1:f90SKNnmHgePjaxB82ZFi3rkXyVIbOJHSYZ3m6n1UUk=
github.com/riverqueue/river/rivertype v0.14.1/go.mod h1:wVOhGBeay6+JcIi0pTFlF4KtUgHYFkhMYv8dpxU46W0=
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
Expand Down
2 changes: 1 addition & 1 deletion riverdriver/riverpgxv5/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/riverqueue/river/riverdriver/riverpgxv5

go 1.21
go 1.22

toolchain go1.23.0

Expand Down
16 changes: 8 additions & 8 deletions riverdriver/riverpgxv5/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/riverqueue/river v0.14.0 h1:y3Ni9hRdnlgKTm/h13aKf9rBYWppm/yV0bM04lHO6qo=
github.com/riverqueue/river v0.14.0/go.mod h1:R98qxNGrFOm1rtapS76Ef6y2WbQ56jtOc2kuVSKW/zA=
github.com/riverqueue/river/riverdriver v0.14.0 h1:H0b26b6DslyrJotLtZW603CMAmkbygBi3FlHtgTwbqc=
github.com/riverqueue/river/riverdriver v0.14.0/go.mod h1:DUayJJgiCWwfnsLC3sLBuM/N1cRh2lEoAohV6bHeaiA=
github.com/riverqueue/river/rivershared v0.14.0 h1:XFyHB7ubPOMfWXcT1ZMlyHvnF7fYgsy3QeAwm6wTj3Y=
github.com/riverqueue/river/rivershared v0.14.0/go.mod h1:CWFseAE5WKSQIE3VxVeKGbRKwAVuDEUGIOGkmJwoYdU=
github.com/riverqueue/river/rivertype v0.14.0 h1:VNlnmp8pMEkfgoLROf6oJxdyh5D7Y8XDEAbJH36xf5Q=
github.com/riverqueue/river/rivertype v0.14.0/go.mod h1:wVOhGBeay6+JcIi0pTFlF4KtUgHYFkhMYv8dpxU46W0=
github.com/riverqueue/river v0.14.1 h1:t9DIYRcjyRH5hMJx/ecB7TTOySIg+CKWAinB1wOXPFU=
github.com/riverqueue/river v0.14.1/go.mod h1:3cQREff7+iGZC+u2lire03SOxUmT41bjzpqZWAWPXtk=
github.com/riverqueue/river/riverdriver v0.14.1 h1:gf8s2v97DKY12i7nvXqBM/ljHOGbkW2dLVmHvxyyegA=
github.com/riverqueue/river/riverdriver v0.14.1/go.mod h1:bJDNRwDNiCyXv3ZEfOGUvGBEo6C3fNnPc4VQRF1P+Ys=
github.com/riverqueue/river/rivershared v0.14.1 h1:lixOqzW20A4f5ubfyl1Gp6TJuSEqYQ2J0UrhB2B12LE=
github.com/riverqueue/river/rivershared v0.14.1/go.mod h1:322qBNl96TTNBdyJ2UNoOfABpvmMAkz4hvnuID1mBs0=
github.com/riverqueue/river/rivertype v0.14.1 h1:f90SKNnmHgePjaxB82ZFi3rkXyVIbOJHSYZ3m6n1UUk=
github.com/riverqueue/river/rivertype v0.14.1/go.mod h1:wVOhGBeay6+JcIi0pTFlF4KtUgHYFkhMYv8dpxU46W0=
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
Expand Down
26 changes: 13 additions & 13 deletions rivershared/cmd/update-mod-go/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (

const sampleGoMod = `module github.com/riverqueue/river
go 1.21
go 1.22
toolchain go1.22.5
toolchain go1.23.1
require (
github.com/riverqueue/river/riverdriver v0.0.0-00010101000000-000000000000
Expand Down Expand Up @@ -58,17 +58,17 @@ func TestParseAndUpdateGoModFile(t *testing.T) {

filename, _ := setup(t)

anyMismatch, err := parseAndUpdateGoModFile(false, filename, "go.work", "1.22", "go1.22.6")
anyMismatch, err := parseAndUpdateGoModFile(false, filename, "go.work", "1.23", "go1.23.2")
require.NoError(t, err)
require.True(t, anyMismatch)

// Reread the file that the command above just wrote and make sure the right
// changes were made.
requireDirectives(t, filename, "1.22", "go1.22.6")
requireDirectives(t, filename, "1.23", "go1.23.2")

// Running again is allowed and should be idempotent. This time it'll
// return that no changes were made.
anyMismatch, err = parseAndUpdateGoModFile(false, filename, "go.work", "1.22", "go1.22.6")
anyMismatch, err = parseAndUpdateGoModFile(false, filename, "go.work", "1.23", "go1.23.2")
require.NoError(t, err)
require.False(t, anyMismatch)
})
Expand All @@ -78,41 +78,41 @@ func TestParseAndUpdateGoModFile(t *testing.T) {

filename, _ := setup(t)

anyMismatch, err := parseAndUpdateGoModFile(false, filename, "go.work", "1.21", "go1.22.5")
anyMismatch, err := parseAndUpdateGoModFile(false, filename, "go.work", "1.22", "go1.23.1")
require.NoError(t, err)
require.False(t, anyMismatch)

// Expect no changes made in file.
requireDirectives(t, filename, "1.21", "go1.22.5")
requireDirectives(t, filename, "1.22", "go1.23.1")
})

t.Run("CheckOnlyGoMismatch", func(t *testing.T) {
t.Parallel()

filename, _ := setup(t)

_, err := parseAndUpdateGoModFile(true, filename, "go.work", "1.22", "go1.22.5")
require.EqualError(t, err, fmt.Sprintf("go directive of %q (%s) doesn't match %q (%s)", filename, "1.21", "go.work", "1.22"))
_, err := parseAndUpdateGoModFile(true, filename, "go.work", "1.23", "go1.23.1")
require.EqualError(t, err, fmt.Sprintf("go directive of %q (%s) doesn't match %q (%s)", filename, "1.22", "go.work", "1.23"))
})

t.Run("CheckOnlyToolchainMismatch", func(t *testing.T) {
t.Parallel()

filename, _ := setup(t)

_, err := parseAndUpdateGoModFile(true, filename, "go.work", "1.21", "go1.22.6")
require.EqualError(t, err, fmt.Sprintf("toolchain directive of %q (%s) doesn't match %q (%s)", filename, "go1.22.5", "go.work", "go1.22.6"))
_, err := parseAndUpdateGoModFile(true, filename, "go.work", "1.22", "go1.23.2")
require.EqualError(t, err, fmt.Sprintf("toolchain directive of %q (%s) doesn't match %q (%s)", filename, "go1.23.1", "go.work", "go1.23.2"))
})

t.Run("CheckOnlyNoChanges", func(t *testing.T) {
t.Parallel()

filename, _ := setup(t)

anyMismatch, err := parseAndUpdateGoModFile(true, filename, "go.work", "1.21", "go1.22.5")
anyMismatch, err := parseAndUpdateGoModFile(true, filename, "go.work", "1.22", "go1.23.1")
require.NoError(t, err)
require.False(t, anyMismatch)

requireDirectives(t, filename, "1.21", "go1.22.5")
requireDirectives(t, filename, "1.22", "go1.23.1")
})
}
2 changes: 1 addition & 1 deletion rivershared/cmd/update-mod-version/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

const sampleGoMod = `module github.com/riverqueue/river
go 1.21
go 1.22
toolchain go1.22.5
Expand Down
2 changes: 1 addition & 1 deletion rivershared/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/riverqueue/river/rivershared

go 1.21
go 1.22

toolchain go1.23.0

Expand Down
12 changes: 6 additions & 6 deletions rivershared/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/riverqueue/river v0.14.0 h1:y3Ni9hRdnlgKTm/h13aKf9rBYWppm/yV0bM04lHO6qo=
github.com/riverqueue/river v0.14.0/go.mod h1:R98qxNGrFOm1rtapS76Ef6y2WbQ56jtOc2kuVSKW/zA=
github.com/riverqueue/river/riverdriver v0.14.0 h1:H0b26b6DslyrJotLtZW603CMAmkbygBi3FlHtgTwbqc=
github.com/riverqueue/river/riverdriver v0.14.0/go.mod h1:DUayJJgiCWwfnsLC3sLBuM/N1cRh2lEoAohV6bHeaiA=
github.com/riverqueue/river/rivertype v0.14.0 h1:VNlnmp8pMEkfgoLROf6oJxdyh5D7Y8XDEAbJH36xf5Q=
github.com/riverqueue/river/rivertype v0.14.0/go.mod h1:wVOhGBeay6+JcIi0pTFlF4KtUgHYFkhMYv8dpxU46W0=
github.com/riverqueue/river v0.14.1 h1:t9DIYRcjyRH5hMJx/ecB7TTOySIg+CKWAinB1wOXPFU=
github.com/riverqueue/river v0.14.1/go.mod h1:3cQREff7+iGZC+u2lire03SOxUmT41bjzpqZWAWPXtk=
github.com/riverqueue/river/riverdriver v0.14.1 h1:gf8s2v97DKY12i7nvXqBM/ljHOGbkW2dLVmHvxyyegA=
github.com/riverqueue/river/riverdriver v0.14.1/go.mod h1:bJDNRwDNiCyXv3ZEfOGUvGBEo6C3fNnPc4VQRF1P+Ys=
github.com/riverqueue/river/rivertype v0.14.1 h1:f90SKNnmHgePjaxB82ZFi3rkXyVIbOJHSYZ3m6n1UUk=
github.com/riverqueue/river/rivertype v0.14.1/go.mod h1:wVOhGBeay6+JcIi0pTFlF4KtUgHYFkhMYv8dpxU46W0=
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
Expand Down
2 changes: 1 addition & 1 deletion rivertype/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/riverqueue/river/rivertype

go 1.21
go 1.22

toolchain go1.23.0

Expand Down

0 comments on commit cef2245

Please sign in to comment.