commit | 11bd64e8f6d707391855f0df02bfa41b4180eb8f | [log] [tgz] |
---|---|---|
author | Todd Wang <toddw@google.com> | Wed Apr 13 00:48:39 2016 -0700 |
committer | Todd Wang <toddw@google.com> | Wed Apr 13 20:59:06 2016 +0000 |
tree | 6a36ab27cba853932f61e309dad03d13951caeed | |
parent | bca5a1335a1860a49ab5def77e650db290b0c089 [diff] |
vdl/vom: Add vom.RawBytes.VDLRead, and some bugfixes. The idea behind vom.RawBytes.VDLRead is straightforward, but there's a catch in the implementation; in order to work (easily), we need to ensure that dec.StartValue hasn't been called. I've restructured the reflect_reader.go code to make this happen. One bugfix is in vdl.Value.VDLRead. It wasn't quite handling type compatibility checks correctly, in both the nil and the non-nil cases. More importantly, I've added logic to allow invalid values (where the type hasn't been set yet) to be read and filled. This is useful given the general reflect_reader.go strategy of creating zero values and calling VDLRead. Another bugfix is in TypeToReflect, to add handling for the ErrorType case. The basic idea is that if we're decoding from error(nil) to any(nil), we should end up with any(error(nil)). Adding the logic to TypeToReflect makes the existing convert.go logic do the right thing, but it's hard to update the test to reflect this. Instead I've added typeToReflectFixed, which adds the ErrorType case, and I've left TypeToReflect as-is. We'll flip over after we remove the existing convert logic. Change-Id: I11b7db2ebbe2593c0da53156f70781bd4c963404
This repository defines the Go APIs of Vanadium.