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/bookmarks/bookmarks_test.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'internal/api/client/bookmarks') diff --git a/internal/api/client/bookmarks/bookmarks_test.go b/internal/api/client/bookmarks/bookmarks_test.go index 9210d6f1c..f056a05b5 100644 --- a/internal/api/client/bookmarks/bookmarks_test.go +++ b/internal/api/client/bookmarks/bookmarks_test.go @@ -18,7 +18,6 @@ package bookmarks_test import ( - "context" "encoding/json" "fmt" "io/ioutil" @@ -198,7 +197,7 @@ func (suite *BookmarkTestSuite) TestGetBookmarksMultiple() { testUser := suite.testUsers["local_account_1"] // Add a few extra bookmarks for this account. - ctx := context.Background() + ctx := suite.T().Context() for _, b := range []*gtsmodel.StatusBookmark{ { ID: "01GSZPDQYE9WZ26T501KMM876V", // oldest @@ -239,7 +238,7 @@ func (suite *BookmarkTestSuite) TestGetBookmarksMultiplePaging() { testUser := suite.testUsers["local_account_1"] // Add a few extra bookmarks for this account. - ctx := context.Background() + ctx := suite.T().Context() for _, b := range []*gtsmodel.StatusBookmark{ { ID: "01GSZPDQYE9WZ26T501KMM876V", // oldest @@ -280,7 +279,7 @@ func (suite *BookmarkTestSuite) TestGetBookmarksNone() { testUser := suite.testUsers["local_account_1"] // Remove all bookmarks for this account. - if err := suite.db.DeleteStatusBookmarks(context.Background(), "", testAccount.ID); err != nil { + if err := suite.db.DeleteStatusBookmarks(suite.T().Context(), "", testAccount.ID); err != nil { suite.FailNow(err.Error()) } @@ -299,7 +298,7 @@ func (suite *BookmarkTestSuite) TestGetBookmarksNonexistentStatus() { testUser := suite.testUsers["local_account_1"] // Add a few extra bookmarks for this account. - ctx := context.Background() + ctx := suite.T().Context() for _, b := range []*gtsmodel.StatusBookmark{ { ID: "01GSZPDQYE9WZ26T501KMM876V", // oldest -- cgit v1.2.3