diff --git a/storage/persisted/codec.gen.go b/storage/persisted/codec.gen.go index 6247b74..7cafce2 100644 --- a/storage/persisted/codec.gen.go +++ b/storage/persisted/codec.gen.go @@ -12,10 +12,10 @@ import ( protobuf "google.golang.org/protobuf/proto" ) -type codec struct { +type codecProto struct { } -func (c codec) Encode(method string, m protobuf.Message) ([]byte, error) { +func (c *codecProto) Encode(method string, m protobuf.Message) ([]byte, error) { buf, err := protobuf.Marshal(m) if err != nil { return nil, err @@ -30,7 +30,7 @@ func (c codec) Encode(method string, m protobuf.Message) ([]byte, error) { return buffer.Bytes(), nil } -func (c codec) Decode(buf []byte) (protobuf.Message, error) { +func (c *codecProto) Decode(buf []byte) (protobuf.Message, error) { hexBuf := bytes.Split(buf, []byte(":")) if len(hexBuf) != 2 { return nil, errorx.New("decode aof err: not a valid aof") diff --git a/storage/temp/aof.template b/storage/temp/aof.template index 1fe2254..bececc4 100644 --- a/storage/temp/aof.template +++ b/storage/temp/aof.template @@ -12,10 +12,10 @@ import ( protobuf "google.golang.org/protobuf/proto" ) -type codec struct { +type codecProto struct { } -func (c codec) Encode(method string, m protobuf.Message) ([]byte, error) { +func (c *codecProto) Encode(method string, m protobuf.Message) ([]byte, error) { buf, err := protobuf.Marshal(m) if err != nil { return nil, err @@ -30,7 +30,7 @@ func (c codec) Encode(method string, m protobuf.Message) ([]byte, error) { return buffer.Bytes(), nil } -func (c codec) Decode(buf []byte) (protobuf.Message, error) { +func (c *codecProto) Decode(buf []byte) (protobuf.Message, error) { hexBuf := bytes.Split(buf, []byte(":")) if len(hexBuf) != 2 { return nil, errorx.New("decode aof err: not a valid aof")