@@ -1877,6 +1877,10 @@ func TestBypassEmptyTsReplacement(t *testing.T) {
18771877 }
18781878 }
18791879
1880+ boolPtr := func (b bool ) * bool {
1881+ return & b
1882+ }
1883+
18801884 mt .Run ("insert one" , func (mt * mtest.T ) {
18811885 doc := bson.D {{"x" , 42 }}
18821886
@@ -1892,12 +1896,12 @@ func TestBypassEmptyTsReplacement(t *testing.T) {
18921896 },
18931897 {
18941898 "false" ,
1895- options .InsertOne (). SetBypassEmptyTsReplacement ( false ),
1899+ & options.InsertOneOptions { BypassEmptyTsReplacement : boolPtr ( false )} ,
18961900 marshalValue (false ),
18971901 },
18981902 {
18991903 "true" ,
1900- options .InsertOne (). SetBypassEmptyTsReplacement ( true ),
1904+ & options.InsertOneOptions { BypassEmptyTsReplacement : boolPtr ( true )} ,
19011905 marshalValue (true ),
19021906 },
19031907 }
@@ -1929,12 +1933,12 @@ func TestBypassEmptyTsReplacement(t *testing.T) {
19291933 },
19301934 {
19311935 "false" ,
1932- options .InsertMany (). SetBypassEmptyTsReplacement ( false ),
1936+ & options.InsertManyOptions { BypassEmptyTsReplacement : boolPtr ( false )} ,
19331937 marshalValue (false ),
19341938 },
19351939 {
19361940 "true" ,
1937- options .InsertMany (). SetBypassEmptyTsReplacement ( true ),
1941+ & options.InsertManyOptions { BypassEmptyTsReplacement : boolPtr ( true )} ,
19381942 marshalValue (true ),
19391943 },
19401944 }
@@ -1964,12 +1968,12 @@ func TestBypassEmptyTsReplacement(t *testing.T) {
19641968 },
19651969 {
19661970 "false" ,
1967- options .Update (). SetBypassEmptyTsReplacement ( false ),
1971+ & options.UpdateOptions { BypassEmptyTsReplacement : boolPtr ( false )} ,
19681972 marshalValue (false ),
19691973 },
19701974 {
19711975 "true" ,
1972- options .Update (). SetBypassEmptyTsReplacement ( true ),
1976+ & options.UpdateOptions { BypassEmptyTsReplacement : boolPtr ( true )} ,
19731977 marshalValue (true ),
19741978 },
19751979 }
@@ -1999,12 +2003,12 @@ func TestBypassEmptyTsReplacement(t *testing.T) {
19992003 },
20002004 {
20012005 "false" ,
2002- options .Update (). SetBypassEmptyTsReplacement ( false ),
2006+ & options.UpdateOptions { BypassEmptyTsReplacement : boolPtr ( false )} ,
20032007 marshalValue (false ),
20042008 },
20052009 {
20062010 "true" ,
2007- options .Update (). SetBypassEmptyTsReplacement ( true ),
2011+ & options.UpdateOptions { BypassEmptyTsReplacement : boolPtr ( true )} ,
20082012 marshalValue (true ),
20092013 },
20102014 }
@@ -2034,12 +2038,12 @@ func TestBypassEmptyTsReplacement(t *testing.T) {
20342038 },
20352039 {
20362040 "false" ,
2037- options .Replace (). SetBypassEmptyTsReplacement ( false ),
2041+ & options.ReplaceOptions { BypassEmptyTsReplacement : boolPtr ( false )} ,
20382042 marshalValue (false ),
20392043 },
20402044 {
20412045 "true" ,
2042- options .Replace (). SetBypassEmptyTsReplacement ( true ),
2046+ & options.ReplaceOptions { BypassEmptyTsReplacement : boolPtr ( true )} ,
20432047 marshalValue (true ),
20442048 },
20452049 }
@@ -2069,12 +2073,12 @@ func TestBypassEmptyTsReplacement(t *testing.T) {
20692073 },
20702074 {
20712075 "false" ,
2072- options .FindOneAndUpdate (). SetBypassEmptyTsReplacement ( false ),
2076+ & options.FindOneAndUpdateOptions { BypassEmptyTsReplacement : boolPtr ( false )} ,
20732077 marshalValue (false ),
20742078 },
20752079 {
20762080 "true" ,
2077- options .FindOneAndUpdate (). SetBypassEmptyTsReplacement ( true ),
2081+ & options.FindOneAndUpdateOptions { BypassEmptyTsReplacement : boolPtr ( true )} ,
20782082 marshalValue (true ),
20792083 },
20802084 }
@@ -2107,12 +2111,12 @@ func TestBypassEmptyTsReplacement(t *testing.T) {
21072111 },
21082112 {
21092113 "false" ,
2110- options .FindOneAndReplace (). SetBypassEmptyTsReplacement ( false ),
2114+ & options.FindOneAndReplaceOptions { BypassEmptyTsReplacement : boolPtr ( false )} ,
21112115 marshalValue (false ),
21122116 },
21132117 {
21142118 "true" ,
2115- options .FindOneAndReplace (). SetBypassEmptyTsReplacement ( true ),
2119+ & options.FindOneAndReplaceOptions { BypassEmptyTsReplacement : boolPtr ( true )} ,
21162120 marshalValue (true ),
21172121 },
21182122 }
@@ -2164,12 +2168,12 @@ func TestBypassEmptyTsReplacement(t *testing.T) {
21642168 },
21652169 {
21662170 "false" ,
2167- options .BulkWrite (). SetBypassEmptyTsReplacement ( false ),
2171+ & options.BulkWriteOptions { BypassEmptyTsReplacement : boolPtr ( false )} ,
21682172 marshalValue (false ),
21692173 },
21702174 {
21712175 "true" ,
2172- options .BulkWrite (). SetBypassEmptyTsReplacement ( true ),
2176+ & options.BulkWriteOptions { BypassEmptyTsReplacement : boolPtr ( true )} ,
21732177 marshalValue (true ),
21742178 },
21752179 }
0 commit comments