[MM-61302] Use model.NewPointer throughout the code base (#28957)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
97c7c25820
Коммит
2424358b7d
@@ -206,9 +206,9 @@ func TestPatchBot(t *testing.T) {
|
||||
}()
|
||||
|
||||
botPatch := &model.BotPatch{
|
||||
Username: sToP("invalid username"),
|
||||
DisplayName: sToP("an updated bot"),
|
||||
Description: sToP("updated bot"),
|
||||
Username: model.NewPointer("invalid username"),
|
||||
DisplayName: model.NewPointer("an updated bot"),
|
||||
Description: model.NewPointer("updated bot"),
|
||||
}
|
||||
|
||||
_, err = th.App.PatchBot(th.Context, bot.UserId, botPatch)
|
||||
@@ -232,9 +232,9 @@ func TestPatchBot(t *testing.T) {
|
||||
}()
|
||||
|
||||
botPatch := &model.BotPatch{
|
||||
Username: sToP("username"),
|
||||
DisplayName: sToP("display name"),
|
||||
Description: sToP(strings.Repeat("x", 1025)),
|
||||
Username: model.NewPointer("username"),
|
||||
DisplayName: model.NewPointer("display name"),
|
||||
Description: model.NewPointer(strings.Repeat("x", 1025)),
|
||||
}
|
||||
|
||||
_, err = th.App.PatchBot(th.Context, bot.UserId, botPatch)
|
||||
@@ -261,9 +261,9 @@ func TestPatchBot(t *testing.T) {
|
||||
}()
|
||||
|
||||
botPatch := &model.BotPatch{
|
||||
Username: sToP("username2"),
|
||||
DisplayName: sToP("updated bot"),
|
||||
Description: sToP("an updated bot"),
|
||||
Username: model.NewPointer("username2"),
|
||||
DisplayName: model.NewPointer("updated bot"),
|
||||
Description: model.NewPointer("an updated bot"),
|
||||
}
|
||||
|
||||
patchedBot, err := th.App.PatchBot(th.Context, createdBot.UserId, botPatch)
|
||||
@@ -296,7 +296,7 @@ func TestPatchBot(t *testing.T) {
|
||||
}()
|
||||
|
||||
botPatch := &model.BotPatch{
|
||||
Username: sToP(th.BasicUser2.Username),
|
||||
Username: model.NewPointer(th.BasicUser2.Username),
|
||||
}
|
||||
|
||||
_, err = th.App.PatchBot(th.Context, bot.UserId, botPatch)
|
||||
@@ -927,7 +927,3 @@ func TestGetSystemBot(t *testing.T) {
|
||||
require.Equal(t, bot.UserId, botUser.Id)
|
||||
})
|
||||
}
|
||||
|
||||
func sToP(s string) *string {
|
||||
return &s
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user