Skip to content

Commit c29474b

Browse files
authored
GODRIVER-2749 Deprecate all Merge*Options functions. (#1183)
1 parent 628d9d8 commit c29474b

38 files changed

+150
-0
lines changed

bson/bsonoptions/byte_slice_codec_options.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ func (bs *ByteSliceCodecOptions) SetEncodeNilAsEmpty(b bool) *ByteSliceCodecOpti
2323
}
2424

2525
// MergeByteSliceCodecOptions combines the given *ByteSliceCodecOptions into a single *ByteSliceCodecOptions in a last one wins fashion.
26+
//
27+
// Deprecated: Merging options structs will not be supported in Go Driver 2.0. Users should create a
28+
// single options struct instead.
2629
func MergeByteSliceCodecOptions(opts ...*ByteSliceCodecOptions) *ByteSliceCodecOptions {
2730
bs := ByteSliceCodec()
2831
for _, opt := range opts {

bson/bsonoptions/empty_interface_codec_options.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ func (e *EmptyInterfaceCodecOptions) SetDecodeBinaryAsSlice(b bool) *EmptyInterf
2323
}
2424

2525
// MergeEmptyInterfaceCodecOptions combines the given *EmptyInterfaceCodecOptions into a single *EmptyInterfaceCodecOptions in a last one wins fashion.
26+
//
27+
// Deprecated: Merging options structs will not be supported in Go Driver 2.0. Users should create a
28+
// single options struct instead.
2629
func MergeEmptyInterfaceCodecOptions(opts ...*EmptyInterfaceCodecOptions) *EmptyInterfaceCodecOptions {
2730
e := EmptyInterfaceCodec()
2831
for _, opt := range opts {

bson/bsonoptions/map_codec_options.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ func (t *MapCodecOptions) SetEncodeKeysWithStringer(b bool) *MapCodecOptions {
4646
}
4747

4848
// MergeMapCodecOptions combines the given *MapCodecOptions into a single *MapCodecOptions in a last one wins fashion.
49+
//
50+
// Deprecated: Merging options structs will not be supported in Go Driver 2.0. Users should create a
51+
// single options struct instead.
4952
func MergeMapCodecOptions(opts ...*MapCodecOptions) *MapCodecOptions {
5053
s := MapCodec()
5154
for _, opt := range opts {

bson/bsonoptions/slice_codec_options.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ func (s *SliceCodecOptions) SetEncodeNilAsEmpty(b bool) *SliceCodecOptions {
2323
}
2424

2525
// MergeSliceCodecOptions combines the given *SliceCodecOptions into a single *SliceCodecOptions in a last one wins fashion.
26+
//
27+
// Deprecated: Merging options structs will not be supported in Go Driver 2.0. Users should create a
28+
// single options struct instead.
2629
func MergeSliceCodecOptions(opts ...*SliceCodecOptions) *SliceCodecOptions {
2730
s := SliceCodec()
2831
for _, opt := range opts {

bson/bsonoptions/string_codec_options.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ func (t *StringCodecOptions) SetDecodeObjectIDAsHex(b bool) *StringCodecOptions
2626
}
2727

2828
// MergeStringCodecOptions combines the given *StringCodecOptions into a single *StringCodecOptions in a last one wins fashion.
29+
//
30+
// Deprecated: Merging options structs will not be supported in Go Driver 2.0. Users should create a
31+
// single options struct instead.
2932
func MergeStringCodecOptions(opts ...*StringCodecOptions) *StringCodecOptions {
3033
s := &StringCodecOptions{&defaultDecodeOIDAsHex}
3134
for _, opt := range opts {

bson/bsonoptions/struct_codec_options.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ func (t *StructCodecOptions) SetAllowUnexportedFields(b bool) *StructCodecOption
5757
}
5858

5959
// MergeStructCodecOptions combines the given *StructCodecOptions into a single *StructCodecOptions in a last one wins fashion.
60+
//
61+
// Deprecated: Merging options structs will not be supported in Go Driver 2.0. Users should create a
62+
// single options struct instead.
6063
func MergeStructCodecOptions(opts ...*StructCodecOptions) *StructCodecOptions {
6164
s := &StructCodecOptions{
6265
OverwriteDuplicatedInlinedFields: &defaultOverwriteDuplicatedInlinedFields,

bson/bsonoptions/time_codec_options.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ func (t *TimeCodecOptions) SetUseLocalTimeZone(b bool) *TimeCodecOptions {
2323
}
2424

2525
// MergeTimeCodecOptions combines the given *TimeCodecOptions into a single *TimeCodecOptions in a last one wins fashion.
26+
//
27+
// Deprecated: Merging options structs will not be supported in Go Driver 2.0. Users should create a
28+
// single options struct instead.
2629
func MergeTimeCodecOptions(opts ...*TimeCodecOptions) *TimeCodecOptions {
2730
t := TimeCodec()
2831
for _, opt := range opts {

bson/bsonoptions/uint_codec_options.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ func (u *UIntCodecOptions) SetEncodeToMinSize(b bool) *UIntCodecOptions {
2323
}
2424

2525
// MergeUIntCodecOptions combines the given *UIntCodecOptions into a single *UIntCodecOptions in a last one wins fashion.
26+
//
27+
// Deprecated: Merging options structs will not be supported in Go Driver 2.0. Users should create a
28+
// single options struct instead.
2629
func MergeUIntCodecOptions(opts ...*UIntCodecOptions) *UIntCodecOptions {
2730
u := UIntCodec()
2831
for _, opt := range opts {

mongo/integration/mtest/setup_options.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ func (so *SetupOptions) SetURI(uri string) *SetupOptions {
2525
}
2626

2727
// MergeSetupOptions combines the given *SetupOptions into a single *Options in a last one wins fashion.
28+
//
29+
// Deprecated: Merging options structs will not be supported in Go Driver 2.0. Users should create a
30+
// single options struct instead.
2831
func MergeSetupOptions(opts ...*SetupOptions) *SetupOptions {
2932
op := NewSetupOptions()
3033
for _, opt := range opts {

mongo/integration/unified/options.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ func (op *Options) SetRunKillAllSessions(killAllSessions bool) *Options {
2727
}
2828

2929
// MergeOptions combines the given *Options into a single *Options in a last one wins fashion.
30+
//
31+
// Deprecated: Merging options structs will not be supported in Go Driver 2.0. Users should create a
32+
// single options struct instead.
3033
func MergeOptions(opts ...*Options) *Options {
3134
op := NewOptions()
3235
for _, opt := range opts {

0 commit comments

Comments
 (0)