@@ -52,14 +52,14 @@ func MarshalAppend(dst []byte, val interface{}) ([]byte, error) {
52
52
// MarshalWithRegistry returns the BSON encoding of val as a BSON document. If val is not a type that can be transformed
53
53
// into a document, MarshalValueWithRegistry should be used instead.
54
54
func MarshalWithRegistry (r * bsoncodec.Registry , val interface {}) ([]byte , error ) {
55
- dst := make ([]byte , 0 , 256 ) // TODO: make the default cap a constant
55
+ dst := make ([]byte , 0 )
56
56
return MarshalAppendWithRegistry (r , dst , val )
57
57
}
58
58
59
59
// MarshalWithContext returns the BSON encoding of val as a BSON document using EncodeContext ec. If val is not a type
60
60
// that can be transformed into a document, MarshalValueWithContext should be used instead.
61
61
func MarshalWithContext (ec bsoncodec.EncodeContext , val interface {}) ([]byte , error ) {
62
- dst := make ([]byte , 0 , 256 ) // TODO: make the default cap a constant
62
+ dst := make ([]byte , 0 )
63
63
return MarshalAppendWithContext (ec , dst , val )
64
64
}
65
65
@@ -115,13 +115,13 @@ func MarshalValueAppend(dst []byte, val interface{}) (bsontype.Type, []byte, err
115
115
116
116
// MarshalValueWithRegistry returns the BSON encoding of val using Registry r.
117
117
func MarshalValueWithRegistry (r * bsoncodec.Registry , val interface {}) (bsontype.Type , []byte , error ) {
118
- dst := make ([]byte , 0 , defaultDstCap )
118
+ dst := make ([]byte , 0 )
119
119
return MarshalValueAppendWithRegistry (r , dst , val )
120
120
}
121
121
122
122
// MarshalValueWithContext returns the BSON encoding of val using EncodeContext ec.
123
123
func MarshalValueWithContext (ec bsoncodec.EncodeContext , val interface {}) (bsontype.Type , []byte , error ) {
124
- dst := make ([]byte , 0 , defaultDstCap )
124
+ dst := make ([]byte , 0 )
125
125
return MarshalValueAppendWithContext (ec , dst , val )
126
126
}
127
127
0 commit comments