Skip to content

Commit 05daabc

Browse files
committed
fix(type bson.ObjectID): fix bson.ObjectID type aliases
1 parent ee7dedf commit 05daabc

File tree

1 file changed

+1
-17
lines changed

1 file changed

+1
-17
lines changed

bson/bson.go

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
package bson
22

33
import (
4-
"bytes"
54
"encoding/hex"
6-
"fmt"
75

86
"go.mongodb.org/mongo-driver/bson"
97
"go.mongodb.org/mongo-driver/bson/primitive"
@@ -54,21 +52,7 @@ type M = primitive.M
5452
type A = primitive.A
5553

5654
// ObjectID primitive.ObjectID
57-
type ObjectID [12]byte
58-
59-
// Hex returns the hex encoding of the ObjectID as a string.
60-
func (id ObjectID) Hex() string {
61-
return hex.EncodeToString(id[:])
62-
}
63-
64-
func (id ObjectID) String() string {
65-
return fmt.Sprintf("ObjectID(%q)", id.Hex())
66-
}
67-
68-
// IsZero returns true if id is the empty ObjectID.
69-
func (id ObjectID) IsZero() bool {
70-
return bytes.Equal(id[:], primitive.NilObjectID[:])
71-
}
55+
type ObjectID = primitive.ObjectID
7256

7357
// NewObjectID primitive.NewObjectID()
7458
var NewObjectID = primitive.NewObjectID()

0 commit comments

Comments
 (0)