Hide common codec methods under helpers
The pending codec -> conversion split changes the signature of Encode and Decode to be more complicated. Create a stub helper with the exact semantics of today and do the simple mechanical refactor here to reduce the cost of that change.
This commit is contained in:
@@ -49,7 +49,7 @@ func TestCompatibility(
|
||||
|
||||
// Decode
|
||||
codec := runtime.CodecFor(api.Scheme, version)
|
||||
obj, err := codec.Decode(input)
|
||||
obj, err := runtime.Decode(codec, input)
|
||||
if err != nil {
|
||||
t.Fatalf("Unexpected error: %v", err)
|
||||
}
|
||||
@@ -61,7 +61,7 @@ func TestCompatibility(
|
||||
}
|
||||
|
||||
// Encode
|
||||
output, err := codec.Encode(obj)
|
||||
output, err := runtime.Encode(codec, obj)
|
||||
if err != nil {
|
||||
t.Fatalf("Unexpected error: %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user