@@ -644,18 +644,18 @@ func (s *S) TestUpdate(c *C) {
644644 }
645645
646646 // No changes is a no-op and shouldn't return an error.
647- err = coll .Update (M {"k" : 42 }, M {"$set" : M {"n" : 42 }})
647+ _ , err = coll .Update (M {"k" : 42 }, M {"$set" : M {"n" : 42 }})
648648 c .Assert (err , IsNil )
649649
650- err = coll .Update (M {"k" : 42 }, M {"$inc" : M {"n" : 1 }})
650+ _ , err = coll .Update (M {"k" : 42 }, M {"$inc" : M {"n" : 1 }})
651651 c .Assert (err , IsNil )
652652
653653 result := make (M )
654654 err = coll .Find (M {"k" : 42 }).One (result )
655655 c .Assert (err , IsNil )
656656 c .Assert (result ["n" ], Equals , 43 )
657657
658- err = coll .Update (M {"k" : 47 }, M {"k" : 47 , "n" : 47 })
658+ _ , err = coll .Update (M {"k" : 47 }, M {"k" : 47 , "n" : 47 })
659659 c .Assert (err , Equals , mgo .ErrNotFound )
660660
661661 err = coll .Find (M {"k" : 47 }).One (result )
@@ -675,15 +675,15 @@ func (s *S) TestUpdateId(c *C) {
675675 c .Assert (err , IsNil )
676676 }
677677
678- err = coll .UpdateId (42 , M {"$inc" : M {"n" : 1 }})
678+ _ , err = coll .UpdateId (42 , M {"$inc" : M {"n" : 1 }})
679679 c .Assert (err , IsNil )
680680
681681 result := make (M )
682682 err = coll .FindId (42 ).One (result )
683683 c .Assert (err , IsNil )
684684 c .Assert (result ["n" ], Equals , 43 )
685685
686- err = coll .UpdateId (47 , M {"k" : 47 , "n" : 47 })
686+ _ , err = coll .UpdateId (47 , M {"k" : 47 , "n" : 47 })
687687 c .Assert (err , Equals , mgo .ErrNotFound )
688688
689689 err = coll .FindId (47 ).One (result )
@@ -699,7 +699,7 @@ func (s *S) TestUpdateNil(c *C) {
699699
700700 err = coll .Insert (M {"k" : 42 , "n" : 42 })
701701 c .Assert (err , IsNil )
702- err = coll .Update (nil , M {"$inc" : M {"n" : 1 }})
702+ _ , err = coll .Update (nil , M {"$inc" : M {"n" : 1 }})
703703 c .Assert (err , IsNil )
704704
705705 result := make (M )
@@ -709,7 +709,7 @@ func (s *S) TestUpdateNil(c *C) {
709709
710710 err = coll .Insert (M {"k" : 45 , "n" : 45 })
711711 c .Assert (err , IsNil )
712- _ , err = coll .UpdateAll (nil , M {"$inc" : M {"n" : 1 }})
712+ _ , _ , err = coll .UpdateAll (nil , M {"$inc" : M {"n" : 1 }})
713713 c .Assert (err , IsNil )
714714
715715 err = coll .Find (M {"k" : 42 }).One (result )
@@ -843,7 +843,7 @@ func (s *S) TestUpdateAll(c *C) {
843843 c .Assert (info .Matched , Equals , 4 )
844844 }
845845
846- info , err = coll .UpdateAll (M {"k" : M {"$gt" : 42 }}, M {"$inc" : M {"n" : 1 }})
846+ info , _ , err = coll .UpdateAll (M {"k" : M {"$gt" : 42 }}, M {"$inc" : M {"n" : 1 }})
847847 c .Assert (err , IsNil )
848848 c .Assert (info .Updated , Equals , 4 )
849849 c .Assert (info .Matched , Equals , 4 )
@@ -863,7 +863,7 @@ func (s *S) TestUpdateAll(c *C) {
863863
864864 if ! s .versionAtLeast (2 , 6 ) {
865865 // 2.6 made this invalid.
866- info , err = coll .UpdateAll (M {"k" : 47 }, M {"k" : 47 , "n" : 47 })
866+ info , _ , err = coll .UpdateAll (M {"k" : 47 }, M {"k" : 47 , "n" : 47 })
867867 c .Assert (err , Equals , nil )
868868 c .Assert (info .Updated , Equals , 0 )
869869 }
@@ -882,7 +882,7 @@ func (s *S) TestRemove(c *C) {
882882 c .Assert (err , IsNil )
883883 }
884884
885- err = coll .Remove (M {"n" : M {"$gt" : 42 }})
885+ _ , err = coll .Remove (M {"n" : M {"$gt" : 42 }})
886886 c .Assert (err , IsNil )
887887
888888 result := & struct { N int }{}
@@ -1160,7 +1160,7 @@ func (s *S) TestCreateCollectionValidator(c *C) {
11601160 c .Assert (err , IsNil )
11611161 err = coll .Insert (M {"a" : 2 })
11621162 c .Assert (err , ErrorMatches , "Document failed validation" )
1163- err = coll .Update (M {"a" : 1 }, M {"c" : 1 })
1163+ _ , err = coll .Update (M {"a" : 1 }, M {"c" : 1 })
11641164 c .Assert (err , IsNil )
11651165 err = coll .DropCollection ()
11661166 c .Assert (err , IsNil )
@@ -1556,10 +1556,10 @@ func (s *S) TestView(c *C) {
15561556 err = view .Insert (bson.M {"_id" : 5 , "nm" : "b" })
15571557 c .Assert (err , NotNil )
15581558
1559- err = view .Remove (bson.M {"_id" : 2 })
1559+ _ , err = view .Remove (bson.M {"_id" : 2 })
15601560 c .Assert (err , NotNil )
15611561
1562- err = view .Update (bson.M {"_id" : 2 }, bson.M {"$set" : bson.M {"d" : true }})
1562+ _ , err = view .Update (bson.M {"_id" : 2 }, bson.M {"$set" : bson.M {"d" : true }})
15631563 c .Assert (err , NotNil )
15641564
15651565 err = db .C ("myview" ).DropCollection ()
@@ -5018,19 +5018,19 @@ func (s *S) TestBypassValidation(c *C) {
50185018 err = coll .Insert (M {"n" : 2 })
50195019 c .Assert (err , ErrorMatches , "Document failed validation" )
50205020
5021- err = coll .Update (M {"n" : 1 }, M {"n" : 10 })
5021+ _ , err = coll .Update (M {"n" : 1 }, M {"n" : 10 })
50225022 c .Assert (err , ErrorMatches , "Document failed validation" )
50235023
50245024 session .SetBypassValidation (true )
50255025
50265026 err = coll .Insert (M {"n" : 3 })
50275027 c .Assert (err , IsNil )
50285028
5029- err = coll .Update (M {"n" : 3 }, M {"n" : 4 })
5029+ _ , err = coll .Update (M {"n" : 3 }, M {"n" : 4 })
50305030 c .Assert (err , IsNil )
50315031
50325032 // Ensure this still works. Shouldn't be affected.
5033- err = coll .Remove (M {"n" : 1 })
5033+ _ , err = coll .Remove (M {"n" : 1 })
50345034 c .Assert (err , IsNil )
50355035
50365036 var result struct { N int }
0 commit comments