With a type like:
type toy struct { a string `bson:"a"` b string `bson:"b"` }
In the snippet below:
example := &toy{} err := bson.Unmarshal(data, example) ....
If data contains `a` with a `nil` value, I get the error: "cannot decode null into a string type".
It would be helpful to get the full field path included in the error message as well.
- related to
-
GODRIVER-952 Lack of context in error description like "cannot decode 64-bit integer into a string type"
- Closed