mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-30 08:22:24 -05:00
[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:
parent
ec4d4d0115
commit
d5c9c4adc1
175 changed files with 857 additions and 1004 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue