Skip to content

Commit

Permalink
Decoder (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
cristaloleg authored Dec 8, 2023
1 parent 8ccde10 commit d244b3c
Show file tree
Hide file tree
Showing 4 changed files with 533 additions and 9 deletions.
10 changes: 10 additions & 0 deletions bson.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@ type Unmarshaler interface {
UnmarshalBSON([]byte) error
}

// Unmarshal parses the BSON data and stores the result
// in the value pointed to by v.
func Unmarshal(data []byte, v any) error {
d := NewDecodeBytes(data)
if err := d.Decode(v); err != nil {
return err
}
return nil
}

// A is a BSON array.
//
// Example:
Expand Down
Loading

0 comments on commit d244b3c

Please sign in to comment.