From 877cc9148f95552f51891d45d588af799033ceb8 Mon Sep 17 00:00:00 2001 From: Jiepeng Cao Date: Mon, 27 Feb 2023 15:44:35 +0800 Subject: [PATCH] Remove redundant code (#6087) --- tests/query_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/query_test.go b/tests/query_test.go index 88e93c77..b6bd0736 100644 --- a/tests/query_test.go +++ b/tests/query_test.go @@ -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] {