Closed nrwiersma closed 3 years ago
I appreciate the PR, @nrwiersma. I assume it's an improvement, but as a NewB to Lorca, I'm curious about the reason for it. What happens currently when a nil is returned? (from JS, yes?) Thx!
@timcolson If you call To(interface{})
when it is nil you get some fairly nasty errors.
Thx @nrwiersma, I appreciate the context. Surface of change seems minimal, so curious to see if @zserge will merge it in. 👍
I have no objections against the Bytes()
method. But I think that adding it to the existing Value
interface would still be backwards-compatible (adding methods should be fine, unlike removing/renaming them). I double anyone implements this interface outside of Lorca. And it should simplify the calling code.
Yay! Another merge. Woot! 👍
To allow for the detection of a
nil
return, a new interface is added (to maintain backwards compatibility) and implemented byvalue
. This interface,RawValue
, allows the retrieval of the raw bytes but requires a type assertion.Fixes #126