vom: move magicbyte handling into encode/decode.
* move magicbyte handling into encode/decode and change
New{Encoder,Decoder} API to no return error any more.
MultiPart: 2/3
Change-Id: I9ceef311128c4b422494d4cd7929bfc1e420508f
diff --git a/lib/security/storage.go b/lib/security/storage.go
index 1690c91..07058f3 100644
--- a/lib/security/storage.go
+++ b/lib/security/storage.go
@@ -25,11 +25,7 @@
if err != nil {
return err
}
- enc, err := vom.NewEncoder(swc)
- if err != nil {
- swc.Close()
- return err
- }
+ enc := vom.NewEncoder(swc)
if err := enc.Encode(obj); err != nil {
swc.Close()
return err
@@ -47,9 +43,6 @@
if err != nil {
return err
}
- dec, err := vom.NewDecoder(vr)
- if err != nil {
- return err
- }
+ dec := vom.NewDecoder(vr)
return dec.Decode(obj)
}