当我尝试对一些代码进行单元测试时,我有一些这样的断言:
expected := []interface{}{1}
actual := []interface{}{float64(1)}
if !reflect.DeepEqual(expected, actual); {
t.Errorf("Expected <%T> %#v to equal <%T> %#v", actual, actual, expected, expected);
}
并得到这个输出:
Expected <[]interface {}> []interface {}{1} to equal <[]interface {}> []interface {}{1}
如何打印此消息以更明确?
蓝山帝景
相关分类