summaryrefslogtreecommitdiff
path: root/service/metrics/config_test.go
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-03-21 09:55:16 +0000
committerGitHub <[email protected]>2020-03-21 09:55:16 +0000
commitaafa0af51ff0c9e504486b593d45fcc0e3c778fc (patch)
tree92f4aaf0ee8855385780d4e6d35adca44634eba0 /service/metrics/config_test.go
parentca497b21bcc33361867d16e1709c55f0313128a7 (diff)
parenta3f07d7bc55031cacccfd3dcbdf93d7e53d3479c (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.go7
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"}}`}