diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-03-21 09:55:16 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-03-21 09:55:16 +0000 |
commit | aafa0af51ff0c9e504486b593d45fcc0e3c778fc (patch) | |
tree | 92f4aaf0ee8855385780d4e6d35adca44634eba0 /service/metrics/config_test.go | |
parent | ca497b21bcc33361867d16e1709c55f0313128a7 (diff) | |
parent | a3f07d7bc55031cacccfd3dcbdf93d7e53d3479c (diff) |
Merge #282
282: Replace std json package with github.com/json-iterator/go r=48d90782 a=48d90782
resolves #281
1. Add `go vendor` command to Makefile as workaround for php vendor folder + go vendor folder hack
2. Use faster json package instead of std
3. Update GHA
Co-authored-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'service/metrics/config_test.go')
-rw-r--r-- | service/metrics/config_test.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/service/metrics/config_test.go b/service/metrics/config_test.go index ad60102b..a64e9047 100644 --- a/service/metrics/config_test.go +++ b/service/metrics/config_test.go @@ -1,7 +1,7 @@ package metrics import ( - "encoding/json" + json "github.com/json-iterator/go" "github.com/prometheus/client_golang/prometheus" "github.com/spiral/roadrunner/service" "github.com/stretchr/testify/assert" @@ -11,7 +11,10 @@ import ( type mockCfg struct{ cfg string } func (cfg *mockCfg) Get(name string) service.Config { return nil } -func (cfg *mockCfg) Unmarshal(out interface{}) error { return json.Unmarshal([]byte(cfg.cfg), out) } +func (cfg *mockCfg) Unmarshal(out interface{}) error { + j := json.ConfigCompatibleWithStandardLibrary + return j.Unmarshal([]byte(cfg.cfg), out) +} func Test_Config_Hydrate_Error1(t *testing.T) { cfg := &mockCfg{`{"request": {"From": "Something"}}`} |