API: Encoder and Decoder options are chainable (#670)

Fixes #583
This commit is contained in:
Thomas Pelletier
2021-11-13 19:04:53 -05:00
committed by GitHub
parent 4dff8eaa4d
commit 64fe47161f
3 changed files with 11 additions and 6 deletions
+2 -1
View File
@@ -48,8 +48,9 @@ func NewDecoder(r io.Reader) *Decoder {
// that could not be set on the target value. In that case, the decoder returns
// a StrictMissingError that can be used to retrieve the individual errors as
// well as generate a human readable description of the missing fields.
func (d *Decoder) SetStrict(strict bool) {
func (d *Decoder) SetStrict(strict bool) *Decoder {
d.strict = strict
return d
}
// Decode the whole content of r into v.