commit | 403ad9314b8376d8a71c2b18538c71a631691dd9 | [log] [tgz] |
---|---|---|
author | Todd Wang <toddw@google.com> | Tue Apr 26 16:53:28 2016 -0700 |
committer | Todd Wang <toddw@google.com> | Tue Apr 26 16:53:28 2016 -0700 |
tree | ab1caf2d84a79d23bc9eab26d08d52d09f7f41cc | |
parent | f690d4d8a47d4ce800cf14cedfdc4d4fc4ab1838 [diff] |
Remove time.Deadline 0 value semantics. [See below about a bugfix attached to this CL] As a recap, time.Deadline is a native type representing deadlines using an absolute time, while time.WireDeadline is a wire type representing deadlines using a relative duration from now. In both old and new code, the native time.Deadline indicates "no deadline" using time.Time.IsZero(). The old code set WireDeadline.NoDeadline to indicate the "no deadline" case. This is bad, since it means the zero-value semantics are different between the native and wire types, which is annoying for VDL/VOM. The new code removes the WireDeadline.NoDeadline field, and instead uses WireDeadline.FromNow=0 as a sentry to indicate "no deadline". This leaves open a tiny (but non-zero) possibility that new binaries will interpret old binaries incorrectly. But that seems fine for now; even if it happens, it shouldn't have a big impact. [BUGFIX] Annoyingly this exposed a bug in the old generated decoders. We need to return the special-case vdl.ErrFieldNoExist when encountering non-existent fields, in order for backwards compatibility to work for unknown struct fields. But we weren't. This CL also fixes that bug. MultiPart: 1/4 Change-Id: If213cea2d8266e578d9b4b3bc046c6bf676648d7
This repository defines the Go APIs of Vanadium.