From d5c9c4adc167cdb05e73f5105702cf340293e61c Mon Sep 17 00:00:00 2001 From: Daenney Date: Thu, 22 May 2025 12:26:11 +0200 Subject: [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 Co-committed-by: Daenney --- internal/db/bundb/basic_test.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'internal/db/bundb/basic_test.go') diff --git a/internal/db/bundb/basic_test.go b/internal/db/bundb/basic_test.go index bdda1cad3..cc4303666 100644 --- a/internal/db/bundb/basic_test.go +++ b/internal/db/bundb/basic_test.go @@ -18,7 +18,6 @@ package bundb_test import ( - "context" "crypto/rand" "crypto/rsa" "testing" @@ -37,7 +36,7 @@ func (suite *BasicTestSuite) TestGetAccountByID() { testAccount := suite.testAccounts["local_account_1"] a := >smodel.Account{} - err := suite.db.GetByID(context.Background(), testAccount.ID, a) + err := suite.db.GetByID(suite.T().Context(), testAccount.ID, a) suite.NoError(err) } @@ -60,12 +59,12 @@ func (suite *BasicTestSuite) TestPutAccountWithBunDefaultFields() { PublicKey: &key.PublicKey, } - if err := suite.db.Put(context.Background(), testAccount); err != nil { + if err := suite.db.Put(suite.T().Context(), testAccount); err != nil { suite.FailNow(err.Error()) } a := >smodel.Account{} - if err := suite.db.GetByID(context.Background(), testAccount.ID, a); err != nil { + if err := suite.db.GetByID(suite.T().Context(), testAccount.ID, a); err != nil { suite.FailNow(err.Error()) } @@ -111,7 +110,7 @@ func (suite *BasicTestSuite) TestPutAccountWithBunDefaultFields() { func (suite *BasicTestSuite) TestGetAllStatuses() { s := []*gtsmodel.Status{} - err := suite.db.GetAll(context.Background(), &s) + err := suite.db.GetAll(suite.T().Context(), &s) suite.NoError(err) suite.Len(s, 30) } @@ -125,7 +124,7 @@ func (suite *BasicTestSuite) TestGetAllNotNull() { a := []*gtsmodel.Account{} - err := suite.db.GetWhere(context.Background(), where, &a) + err := suite.db.GetWhere(suite.T().Context(), where, &a) suite.NoError(err) suite.NotEmpty(a) -- cgit v1.2.3