I want to compare two objects
expected:= `"{\"method\":\"GET\",\"body\":{},\"uploadCount\":0}"`
result := `"{\"name\":\"xyz\",\"method\":\"GET\",\"body\":{},\"uploadCount\":0}"`
Now as we can see result is super-set of expected but when I use reflect.deepequal, it says false because it exactly compare two objects. I want to compare if result is superset of expected or not.
func main(){
result := "{\"name\":\"xyz\",\"method\":\"GET\",\"body\":{},\"uploadCount\":0}"
expected := "{\"method\":\"GET\",\"body\":{},\"uploadCount\":0}"
var _result interface{}
var _expected interface{}
json.Unmarshal([]byte(result),&_result)
json.Unmarshal([]byte(expected),&_expected)
reflect.deepequal(_result,_expected)
}