Skip to content

Commit 6c9d476

Browse files
committed
Move BSON reflect types to where they're used.
1 parent e48bfee commit 6c9d476

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

bson/marshal_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ import (
2222
"go.mongodb.org/mongo-driver/x/bsonx/bsoncore"
2323
)
2424

25+
var tInt32 = reflect.TypeOf(int32(0))
26+
2527
func TestMarshalAppendWithRegistry(t *testing.T) {
2628
for _, tc := range marshalingTestCases {
2729
t.Run(tc.name, func(t *testing.T) {

bson/primitive_codecs.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ import (
1414
"go.mongodb.org/mongo-driver/bson/bsonrw"
1515
)
1616

17+
var tRawValue = reflect.TypeOf(RawValue{})
18+
var tRaw = reflect.TypeOf(Raw(nil))
19+
1720
var primitiveCodecs PrimitiveCodecs
1821

1922
// PrimitiveCodecs is a namespace for all of the default bsoncodec.Codecs for the primitive types

bson/types.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
package bson
88

99
import (
10-
"reflect"
11-
1210
"go.mongodb.org/mongo-driver/bson/bsontype"
1311
)
1412

@@ -36,7 +34,3 @@ const (
3634
TypeMinKey = bsontype.MinKey
3735
TypeMaxKey = bsontype.MaxKey
3836
)
39-
40-
var tRawValue = reflect.TypeOf(RawValue{})
41-
var tInt32 = reflect.TypeOf(int32(0))
42-
var tRaw = reflect.TypeOf(Raw(nil))

0 commit comments

Comments
 (0)