diff options
Diffstat (limited to 'service/container_test.go')
-rw-r--r-- | service/container_test.go | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/service/container_test.go b/service/container_test.go index d7ca73a7..b3ec7054 100644 --- a/service/container_test.go +++ b/service/container_test.go @@ -1,8 +1,8 @@ package service import ( - "encoding/json" "errors" + json "github.com/json-iterator/go" "github.com/sirupsen/logrus" "github.com/sirupsen/logrus/hooks/test" "github.com/stretchr/testify/assert" @@ -67,7 +67,8 @@ type testCfg struct{ cfg string } func (cfg *testCfg) Get(name string) Config { vars := make(map[string]interface{}) - err := json.Unmarshal([]byte(cfg.cfg), &vars) + j := json.ConfigCompatibleWithStandardLibrary + err := j.Unmarshal([]byte(cfg.cfg), &vars) if err != nil { panic("error unmarshalling the cfg.cfg value") } @@ -77,10 +78,13 @@ func (cfg *testCfg) Get(name string) Config { return nil } - d, _ := json.Marshal(v) + d, _ := j.Marshal(v) return &testCfg{cfg: string(d)} } -func (cfg *testCfg) Unmarshal(out interface{}) error { return json.Unmarshal([]byte(cfg.cfg), out) } +func (cfg *testCfg) Unmarshal(out interface{}) error { + j := json.ConfigCompatibleWithStandardLibrary + return j.Unmarshal([]byte(cfg.cfg), out) +} // Config defines RPC service config. type dConfig struct { |