mirror of
https://github.com/go-micro/go-micro.git
synced 2024-11-24 08:02:32 +02:00
1948e8a0d7
Modify "Name()" to "String()" of proto.Marshaler
20 lines
358 B
Go
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"
|
|
}
|