codec: register on init

Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
This commit is contained in:
Adphi 2023-04-19 14:24:28 +02:00
parent e295da1988
commit 3af87d65d6
Signed by: adphi
GPG Key ID: 46BE4062DB2397FF

View File

@ -3,6 +3,8 @@ package codec
import ( import (
"fmt" "fmt"
"google.golang.org/grpc/encoding"
_ "google.golang.org/grpc/encoding/proto"
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
) )
@ -50,3 +52,7 @@ func (Codec) Unmarshal(data []byte, v interface{}) error {
func (Codec) Name() string { func (Codec) Name() string {
return Name return Name
} }
func init() {
encoding.RegisterCodec(Codec{})
}