比较2个结构时,go-cmp将空接口值视为int和flat64

So I am using go-cmp github.com/google/go-cmp/cmp. To compare 2 structs. Both the structs are of same type. When comparing the result I am seeing the following difference.

I am using go v1.12

type Sample struct{
   Field1 map[string]interface
}
var a Sample
var b Sample

cmp.Diff(a,b)


// Somewhere in code I do this
a.Field1["sample"] = 1 // this is optional.

So if I compare a and b I see the diff where it interprets the same field as int(0) and float64(0)

-: int(0)
+: float64(0)

I expect the diff to be nil

As the struct was unmarshalled from json, json treats all numbers as float