Remove redundant code (#6087)

This commit is contained in:
Jiepeng Cao 2023-02-27 15:44:35 +08:00 committed by GitHub
parent a80707de9e
commit 877cc9148f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -218,7 +218,7 @@ func TestFind(t *testing.T) {
// test array
var models2 [3]User
if err := DB.Where("name in (?)", []string{"find"}).Find(&models2).Error; err != nil || len(models2) != 3 {
if err := DB.Where("name in (?)", []string{"find"}).Find(&models2).Error; err != nil {
t.Errorf("errors happened when query find with in clause: %v, length: %v", err, len(models2))
} else {
for idx, user := range users {
@ -230,7 +230,7 @@ func TestFind(t *testing.T) {
// test smaller array
var models3 [2]User
if err := DB.Where("name in (?)", []string{"find"}).Find(&models3).Error; err != nil || len(models3) != 2 {
if err := DB.Where("name in (?)", []string{"find"}).Find(&models3).Error; err != nil {
t.Errorf("errors happened when query find with in clause: %v, length: %v", err, len(models3))
} else {
for idx, user := range users[:2] {