Skip to content

Commit 057b490

Browse files
committed
Adding ability to inject options to UnmarshalMessage
1 parent bf7fe62 commit 057b490

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

gen/gotpl/extra.qtpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ type empty struct{}
450450
var emptyVal = &empty{}
451451

452452
// UnmarshalMessage unmarshals the message result or params.
453-
func UnmarshalMessage(msg *Message) (any, error) {
453+
func UnmarshalMessage(msg *Message, opts ...jsonv2.Options) (any, error) {
454454
var v any
455455
switch msg.Method {{% for _, d := range domains %}{% for _, c := range d.Commands %}
456456
case {%s= CommandMethodType(c, d) %}:{% if len(c.Returns) == 0 %}
@@ -471,7 +471,7 @@ func UnmarshalMessage(msg *Message) (any, error) {
471471
default:
472472
return nil, cdp.ErrMsgMissingParamsOrResult
473473
}
474-
if err := jsonv2.Unmarshal(buf, v); err != nil {
474+
if err := jsonv2.Unmarshal(buf, v, opts...); err != nil {
475475
return nil, err
476476
}
477477
return v, nil

gen/gotpl/extra.qtpl.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)