Fix staticcheck errors from _test.go files (#18033)

Automatic Merge
Этот коммит содержится в:
dave
2021-08-10 13:15:03 +08:00
коммит произвёл GitHub
родитель 3f01129ddf
Коммит 16c2925ba2
28 изменённых файлов: 70 добавлений и 88 удалений

Просмотреть файл

@@ -246,7 +246,15 @@ func TestBotPreSave(t *testing.T) {
DeleteAt: 0,
}
originalBot := &*bot
originalBot := &Bot{
UserId: bot.UserId,
Username: bot.Username,
DisplayName: bot.DisplayName,
Description: bot.Description,
OwnerId: bot.OwnerId,
LastIconUpdate: bot.LastIconUpdate,
DeleteAt: bot.DeleteAt,
}
bot.PreSave()
assert.NotEqual(t, 0, bot.CreateAt)
@@ -269,11 +277,20 @@ func TestBotPreUpdate(t *testing.T) {
DeleteAt: 0,
}
originalBot := &*bot
originalBot := &Bot{
UserId: bot.UserId,
Username: bot.Username,
DisplayName: bot.DisplayName,
Description: bot.Description,
OwnerId: bot.OwnerId,
LastIconUpdate: bot.LastIconUpdate,
DeleteAt: bot.DeleteAt,
}
bot.PreSave()
assert.NotEqual(t, 0, bot.UpdateAt)
originalBot.CreateAt = bot.CreateAt
originalBot.UpdateAt = bot.UpdateAt
assert.Equal(t, originalBot, bot)
}

Просмотреть файл

@@ -157,7 +157,7 @@ func TestConfigIsValidDefaultAlgorithms(t *testing.T) {
func TestConfigServiceProviderDefault(t *testing.T) {
c1 := &Config{
SamlSettings: *&SamlSettings{
SamlSettings: SamlSettings{
Enable: NewBool(true),
Verify: NewBool(false),
Encrypt: NewBool(false),