use codec to unmarshal

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2020-12-11 02:12:36 +03:00
parent 4c529af53f
commit bdc6232ea9
1 changed files with 1 additions and 2 deletions

View File

@ -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 {