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/api/client/search/searchget_test.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'internal/api/client/search/searchget_test.go') diff --git a/internal/api/client/search/searchget_test.go b/internal/api/client/search/searchget_test.go index b978c0d3f..651d5301d 100644 --- a/internal/api/client/search/searchget_test.go +++ b/internal/api/client/search/searchget_test.go @@ -18,7 +18,6 @@ package search_test import ( - "context" "crypto/rand" "crypto/rsa" "encoding/json" @@ -160,7 +159,7 @@ func (suite *SearchGetTestSuite) bodgeLocalInstance(domain string) { // Set username of instance account to given domain. instanceAccount.Username = domain - if err := suite.db.UpdateAccount(context.Background(), instanceAccount, "username"); err != nil { + if err := suite.db.UpdateAccount(suite.T().Context(), instanceAccount, "username"); err != nil { suite.FailNow(err.Error()) } } @@ -1389,7 +1388,7 @@ func (suite *SearchGetTestSuite) TestSearchRemoteInstanceAccountPartial() { suite.FailNow(err.Error()) } - if err := suite.db.PutAccount(context.Background(), >smodel.Account{ + if err := suite.db.PutAccount(suite.T().Context(), >smodel.Account{ ID: "01H6RWPG8T6DNW6VNXPBCJBH5S", Username: theirDomain, Domain: theirDomain, @@ -1724,7 +1723,7 @@ func (suite *SearchGetTestSuite) TestSearchBlockedAccountFullNamestring() { // Block the account // we're about to search. if err := suite.db.PutBlock( - context.Background(), + suite.T().Context(), >smodel.Block{ ID: id.NewULID(), URI: "https://example.org/nooooooo", @@ -1788,7 +1787,7 @@ func (suite *SearchGetTestSuite) TestSearchBlockedAccountPartialNamestring() { // Block the account // we're about to search. if err := suite.db.PutBlock( - context.Background(), + suite.T().Context(), >smodel.Block{ ID: id.NewULID(), URI: "https://example.org/nooooooo", @@ -1849,7 +1848,7 @@ func (suite *SearchGetTestSuite) TestSearchBlockedAccountURI() { // Block the account // we're about to search. if err := suite.db.PutBlock( - context.Background(), + suite.T().Context(), >smodel.Block{ ID: id.NewULID(), URI: "https://example.org/nooooooo", -- cgit v1.2.3