Skip to content

Commit

Permalink
clear lint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
casualjim committed Dec 7, 2023
1 parent ae6aace commit e659c66
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bson.go
Expand Up @@ -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

Check warning on line 138 in bson.go

View check run for this annotation

Codecov / codecov/patch

bson.go#L138

Added line #L138 was not covered by tests
}

// UnmarshalBSONValue is an interface implemented by types that can unmarshal a
Expand Down
4 changes: 2 additions & 2 deletions time.go
Expand Up @@ -247,15 +247,15 @@ 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
// BSON value representation of themselves. The BSON bytes and type can be
// 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
}
Expand Down

0 comments on commit e659c66

Please sign in to comment.