PaesslerAG / gval

Expression evaluation in golang
BSD 3-Clause "New" or "Revised" License
731 stars 82 forks source link

Allow nil arguments for function #84

Closed vicpatel closed 2 years ago

vicpatel commented 2 years ago

It allows nil as an argument for function, so this chance will use reflect value for the interface when argument is resolved as nil instead of throwing an error.

This is necessary for some scenarios where nil is expected as an argument but createCallArguments throws an error for the nil argument hence the underlying referenced function is resulting in an error. eg. IsNil(i interface {}) bool.

This will solve this problem but of course, Is there any workaround for this?

Please take a look.