update micro

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2020-12-13 13:30:00 +03:00
parent d275b4643a
commit 33521493f4
3 changed files with 8 additions and 35 deletions

View File

@@ -5,7 +5,6 @@ import (
"errors"
"github.com/hashicorp/consul/api"
jsoncodec "github.com/unistack-org/micro-codec-json"
"github.com/unistack-org/micro/v3/config"
)
@@ -29,6 +28,10 @@ func (c *consulConfig) Init(opts ...config.Option) error {
o(&c.opts)
}
if c.opts.Codec == nil {
return config.ErrCodecMissing
}
cfg := api.DefaultConfigWithLogger(&consulLogger{logger: c.opts.Logger})
path := ""
@@ -100,6 +103,5 @@ func NewConfig(opts ...config.Option) config.Config {
if len(options.StructTag) == 0 {
options.StructTag = DefaultStructTag
}
options.Codec = jsoncodec.NewCodec()
return &consulConfig{opts: options}
}