55
66 . "github.com/bsm/ginkgo/v2"
77 . "github.com/bsm/gomega"
8+
89 "github.com/redis/go-redis/v9"
910)
1011
@@ -13,7 +14,6 @@ type JSONGetTestStruct struct {
1314}
1415
1516var _ = Describe ("JSON Commands" , Label ("json" ), func () {
16-
1717 ctx := context .TODO ()
1818 var client * redis.Client
1919
@@ -27,7 +27,6 @@ var _ = Describe("JSON Commands", Label("json"), func() {
2727 })
2828
2929 Describe ("arrays" , Label ("arrays" ), func () {
30-
3130 It ("should JSONArrAppend" , Label ("json.arrappend" , "json" ), func () {
3231 cmd1 := client .JSONSet (ctx , "append2" , "$" , `{"a": [10], "b": {"a": [12, 13]}}` )
3332 Expect (cmd1 .Err ()).NotTo (HaveOccurred ())
@@ -76,7 +75,6 @@ var _ = Describe("JSON Commands", Label("json"), func() {
7675 res , err = client .JSONArrIndexWithArgs (ctx , "index2" , "$" , & redis.JSONArrIndexArgs {Stop : & stop }, 4 ).Result ()
7776 Expect (err ).NotTo (HaveOccurred ())
7877 Expect (res [0 ]).To (Equal (int64 (- 1 )))
79-
8078 })
8179
8280 It ("should JSONArrIndex and JSONArrIndexWithArgs with $" , Label ("json.arrindex" , "json" ), func () {
@@ -235,7 +233,6 @@ var _ = Describe("JSON Commands", Label("json"), func() {
235233 Expect (cmd3 .Err ()).NotTo (HaveOccurred ())
236234 Expect (cmd3 .Val ()).To (Equal ("[[100,200,200]]" ))
237235 })
238-
239236 })
240237
241238 Describe ("get/set" , Label ("getset" ), func () {
@@ -257,7 +254,6 @@ var _ = Describe("JSON Commands", Label("json"), func() {
257254 res , err = client .JSONGetWithArgs (ctx , "get3" , & redis.JSONGetArgs {Indent : "-" , Newline : `~` , Space : `!` }).Result ()
258255 Expect (err ).NotTo (HaveOccurred ())
259256 Expect (res ).To (Equal (`[~-{~--"a":!1,~--"b":!2~-}~]` ))
260-
261257 })
262258
263259 It ("should JSONMerge" , Label ("json.merge" , "json" ), func () {
@@ -330,13 +326,10 @@ var _ = Describe("JSON Commands", Label("json"), func() {
330326 iRes , err = client .JSONMGet (ctx , "$..a" , "non_existing_doc" , "non_existing_doc1" ).Result ()
331327 Expect (err ).NotTo (HaveOccurred ())
332328 Expect (iRes ).To (Equal ([]interface {}{nil , nil }))
333-
334329 })
335-
336330 })
337331
338332 Describe ("Misc" , Label ("misc" ), func () {
339-
340333 It ("should JSONClear" , Label ("json.clear" , "json" ), func () {
341334 cmd1 := client .JSONSet (ctx , "clear1" , "$" , `[1]` )
342335 Expect (cmd1 .Err ()).NotTo (HaveOccurred ())
@@ -460,7 +453,6 @@ var _ = Describe("JSON Commands", Label("json"), func() {
460453 cmd3 := client .JSONGet (ctx , "forget3" , "$" )
461454 Expect (cmd3 .Err ()).NotTo (HaveOccurred ())
462455 Expect (cmd3 .Val ()).To (Equal (`[{"b":{"b":"annie"}}]` ))
463-
464456 })
465457
466458 It ("should JSONForget with $" , Label ("json.forget" , "json" ), func () {
@@ -622,7 +614,6 @@ var _ = Describe("JSON Commands", Label("json"), func() {
622614 cmd3 , err := client .JSONGet (ctx , "strapp1" , "$" ).Result ()
623615 Expect (err ).NotTo (HaveOccurred ())
624616 Expect (cmd3 ).To (Equal (`["foobar"]` ))
625-
626617 })
627618
628619 It ("should JSONStrAppend and JSONStrLen with $" , Label ("json.strappend" , "json.strlen" , "json" ), func () {
0 commit comments