mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-30 03:52:26 -05:00
[chore] Use generic pointer function (#2080)
This replaces the different $TypePtr functions with a generic implementation.
This commit is contained in:
parent
517829ae6a
commit
be3718f6e4
22 changed files with 393 additions and 391 deletions
|
|
@ -25,7 +25,7 @@ import (
|
|||
"github.com/superseriousbusiness/gotosocial/internal/config"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
|
||||
"github.com/superseriousbusiness/gotosocial/testrig"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/util"
|
||||
)
|
||||
|
||||
type InstanceTestSuite struct {
|
||||
|
|
@ -103,7 +103,7 @@ func (suite *InstanceTestSuite) TestGetInstanceModeratorAddressesZorkAsModerator
|
|||
// Promote zork to moderator role.
|
||||
testUser := >smodel.User{}
|
||||
*testUser = *suite.testUsers["local_account_1"]
|
||||
testUser.Moderator = testrig.TrueBool()
|
||||
testUser.Moderator = util.Ptr(true)
|
||||
if err := suite.db.UpdateUser(context.Background(), testUser, "moderator"); err != nil {
|
||||
suite.FailNow(err.Error())
|
||||
}
|
||||
|
|
@ -117,8 +117,8 @@ func (suite *InstanceTestSuite) TestGetInstanceModeratorAddressesNoAdmin() {
|
|||
// Demote admin from admin + moderator roles.
|
||||
testUser := >smodel.User{}
|
||||
*testUser = *suite.testUsers["admin_account"]
|
||||
testUser.Admin = testrig.FalseBool()
|
||||
testUser.Moderator = testrig.FalseBool()
|
||||
testUser.Admin = util.Ptr(false)
|
||||
testUser.Moderator = util.Ptr(false)
|
||||
if err := suite.db.UpdateUser(context.Background(), testUser, "admin", "moderator"); err != nil {
|
||||
suite.FailNow(err.Error())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue