From c0319f6eed8c56ba09d0b6674d5bcd5e062b9981 Mon Sep 17 00:00:00 2001 From: Jinzhu Date: Fri, 10 Jul 2020 12:52:01 +0800 Subject: [PATCH] Test map with named argument for raw sql --- tests/named_argument_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/named_argument_test.go b/tests/named_argument_test.go index 60f5a535..56fad5f4 100644 --- a/tests/named_argument_test.go +++ b/tests/named_argument_test.go @@ -49,7 +49,7 @@ func TestNamedArg(t *testing.T) { } var result5 NamedUser - if err := DB.Raw("SELECT * FROM named_users WHERE (name1 = @name AND name3 = @name) AND name2 = @name2", sql.Named("name", "jinzhu-new"), sql.Named("name2", "jinzhu-new2")).Find(&result5).Error; err != nil { + if err := DB.Raw("SELECT * FROM named_users WHERE (name1 = @name AND name3 = @name) AND name2 = @name2", map[string]interface{}{"name": "jinzhu-new", "name2": "jinzhu-new2"}).Find(&result5).Error; err != nil { t.Errorf("failed to update with named arg") }