influxdb/server/test_helpers.go

21 lines
326 B
Go

package server
import (
"encoding/json"
"github.com/google/go-cmp/cmp"
)
func jsonEqual(s1, s2 string) (eq bool, err error) {
var o1, o2 interface{}
if err = json.Unmarshal([]byte(s1), &o1); err != nil {
return
}
if err = json.Unmarshal([]byte(s2), &o2); err != nil {
return
}
return cmp.Equal(o1, o2), nil
}