[chore] Upgrade to Go 1.24 (#4187)

* Set `go.mod` to 1.24 now that it's been out for 3 months.
* Update all the test to use `testing.T.Context()`.

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4187
Co-authored-by: Daenney <git@noreply.sourcery.dny.nu>
Co-committed-by: Daenney <git@noreply.sourcery.dny.nu>
This commit is contained in:
Daenney 2025-05-22 12:26:11 +02:00 committed by kim
commit d5c9c4adc1
175 changed files with 857 additions and 1004 deletions

View file

@ -36,7 +36,7 @@ func (suite *ApplicationTestSuite) TestGetApplicationBy() {
t := suite.T()
// Create a new context for this test.
ctx, cncl := context.WithCancel(context.Background())
ctx, cncl := context.WithCancel(suite.T().Context())
defer cncl()
// Sentinel error to mark avoiding a test case.
@ -86,7 +86,7 @@ func (suite *ApplicationTestSuite) TestDeleteApplicationBy() {
t := suite.T()
// Create a new context for this test.
ctx, cncl := context.WithCancel(context.Background())
ctx, cncl := context.WithCancel(suite.T().Context())
defer cncl()
for _, app := range suite.testApplications {
@ -117,7 +117,7 @@ func (suite *ApplicationTestSuite) TestDeleteApplicationBy() {
}
func (suite *ApplicationTestSuite) TestGetAllTokens() {
tokens, err := suite.db.GetAllTokens(context.Background())
tokens, err := suite.db.GetAllTokens(suite.T().Context())
if err != nil {
suite.FailNow(err.Error())
}
@ -125,7 +125,7 @@ func (suite *ApplicationTestSuite) TestGetAllTokens() {
}
func (suite *ApplicationTestSuite) TestDeleteTokensByClientID() {
ctx := context.Background()
ctx := suite.T().Context()
// Delete tokens by each app.
for _, app := range suite.testApplications {
@ -147,7 +147,7 @@ func (suite *ApplicationTestSuite) TestDeleteTokensByUnknownClientID() {
// Should not return ErrNoRows even though
// the client with given ID doesn't exist.
if err := suite.state.DB.DeleteTokensByClientID(
context.Background(),
suite.T().Context(),
"01JPJ4NCGH6GHY7ZVYBHNP55XS",
); err != nil {
suite.FailNow(err.Error())