Skip to content

Commit be0f046

Browse files
Update docs/migration-2.0.md
Co-authored-by: Matt Dale <[email protected]>
1 parent 5538c77 commit be0f046

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/migration-2.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1193,7 +1193,7 @@ fmt.Println("type of data is an array: %v", bson.Type(btype) == bson.TypeArray)
11931193

11941194
### ValueUnmarshaler
11951195

1196-
The `UnmarshalBSONValue` method of the `ValueUnmarshaler` interface is only required to take a byte type argument representing the BSON type to avoid importing the Go driver package. For example:
1196+
The `UnmarshalBSONValue` method of the [ValueUnmarshaler](https://pkg.go.dev/go.mongodb.org/mongo-driver/v2/bson#ValueUnmarshaler) interface now accepts a `byte` value representing the [BSON type](https://pkg.go.dev/go.mongodb.org/mongo-driver/v2/bson#Type) for the first argument. That allows packages to implement `ValueUnmarshaler` without having to import the `bson` package. For example:
11971197

11981198
```go
11991199
if err := m.UnmarshalBSONValue(bson.TypeEmbeddedDocument, bytes); err != nil {

0 commit comments

Comments
 (0)