From e659c669aa51ee7450b8681af755369cb6b4cdc6 Mon Sep 17 00:00:00 2001 From: Ivan Porto Carrero Date: Wed, 6 Dec 2023 23:32:35 -0800 Subject: [PATCH] clear lint warnings --- bson.go | 2 +- time.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bson.go b/bson.go index ddae3fd..cfa9a52 100644 --- a/bson.go +++ b/bson.go @@ -135,7 +135,7 @@ func (id *ObjectId) UnmarshalBSON(data []byte) error { // BSON document if the error is nil. func (id ObjectId) MarshalBSONValue() (bsontype.Type, []byte, error) { oid := bsonprim.ObjectID(id) - return bsontype.ObjectID, oid[:], nil + return bson.TypeObjectID, oid[:], nil } // UnmarshalBSONValue is an interface implemented by types that can unmarshal a diff --git a/time.go b/time.go index 682235d..f08ba4d 100644 --- a/time.go +++ b/time.go @@ -247,7 +247,7 @@ func (t DateTime) MarshalBSONValue() (bsontype.Type, []byte, error) { buf := make([]byte, 8) binary.LittleEndian.PutUint64(buf, uint64(i64)) - return bsontype.DateTime, buf, nil + return bson.TypeDateTime, buf, nil } // UnmarshalBSONValue is an interface implemented by types that can unmarshal a @@ -255,7 +255,7 @@ func (t DateTime) MarshalBSONValue() (bsontype.Type, []byte, error) { // assumed to be valid. UnmarshalBSONValue must copy the BSON value bytes if it // wishes to retain the data after returning. func (t *DateTime) UnmarshalBSONValue(tpe bsontype.Type, data []byte) error { - if tpe == bsontype.Null { + if tpe == bson.TypeNull { *t = DateTime{} return nil }