use codec to unmarshal

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2020-12-11 02:15:59 +03:00
parent bdc6232ea9
commit ba31191b74
3 changed files with 32 additions and 1 deletions

View File

@@ -5,6 +5,7 @@ import (
"errors"
"github.com/hashicorp/consul/api"
jsoncodec "github.com/unistack-org/micro-codec-json"
"github.com/unistack-org/micro/v3/config"
)
@@ -100,5 +101,6 @@ func NewConfig(opts ...config.Option) config.Config {
if len(options.StructTag) == 0 {
options.StructTag = DefaultStructTag
}
options.Codec = jsoncodec.NewCodec()
return &consulConfig{opts: options}
}