From bdc6232ea93ad14744869db17d435ad73625ddad Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Fri, 11 Dec 2020 02:12:36 +0300 Subject: [PATCH] use codec to unmarshal Signed-off-by: Vasiliy Tolstov --- consul.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/consul.go b/consul.go index 96fe0e3..5ff32a5 100644 --- a/consul.go +++ b/consul.go @@ -2,7 +2,6 @@ package consul import ( "context" - "encoding/json" "errors" "github.com/hashicorp/consul/api" @@ -85,7 +84,7 @@ func (c *consulConfig) Load(ctx context.Context) error { return ErrPathNotExist } - return json.Unmarshal(pair.Value, c.opts.Struct) + return c.opts.Codec.Unmarshal(pair.Value, c.opts.Struct) } func (c *consulConfig) Save(ctx context.Context) error {