@@ -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}
|
||||
}
|
||||
|
Reference in New Issue
Block a user