1
0
mirror of https://github.com/go-micro/go-micro.git synced 2024-12-12 08:23:58 +02:00
go-micro/codec/proto/marshaler.go
Zich Liew 1948e8a0d7
Update marshaler.go
Modify "Name()" to "String()" of proto.Marshaler
2019-06-01 16:14:06 +08:00

20 lines
358 B
Go

package proto
import (
"github.com/golang/protobuf/proto"
)
type Marshaler struct{}
func (Marshaler) Marshal(v interface{}) ([]byte, error) {
return proto.Marshal(v.(proto.Message))
}
func (Marshaler) Unmarshal(data []byte, v interface{}) error {
return proto.Unmarshal(data, v.(proto.Message))
}
func (Marshaler) String() string {
return "proto"
}