Hacker News new | ask | show | jobs
by Thaxll 1055 days ago
Not to my knowledge, for example if it's json data, if the json is malformed it will error out, if you have etra field you can error out as well: https://pkg.go.dev/encoding/json#Decoder.DisallowUnknownFiel...

For input that does not have the fields of the destination well you can use other libraries that check that for you or use pointers.

1 comments

> For input that does not have the fields of the destination well you can use other libraries

Right, this is what I was thinking, but that this is the case is the point being made here, and it's consistent with the rest of the post. The default option doesn't really check things for you.