Adding a way to decode to a specified version.
This is largely needed as a way to get a versioned client without requiring everyone to switch to versioned types at once.
This commit is contained in:
@@ -77,3 +77,10 @@ type codecWrapper struct {
|
||||
func (c *codecWrapper) Encode(obj Object) ([]byte, error) {
|
||||
return c.EncodeToVersion(obj, c.version)
|
||||
}
|
||||
|
||||
// TODO: Make this behaviour default when we move everyone away from
|
||||
// the unversioned types.
|
||||
//
|
||||
// func (c *codecWrapper) Decode(data []byte) (Object, error) {
|
||||
// return c.DecodeToVersion(data, c.version)
|
||||
// }
|
||||
|
Reference in New Issue
Block a user