Same asserts that two pointers reference the same object. assert.Same(t, ptr1, ptr2) Both arguments must be pointer variables. Pointer variable sameness is determined based on the equality of both type and value.
(t TestingT, expected interface{}, actual interface{}, msgAndArgs ...interface{})
| 1883 | // Both arguments must be pointer variables. Pointer variable sameness is |
| 1884 | // determined based on the equality of both type and value. |
| 1885 | func Same(t TestingT, expected interface{}, actual interface{}, msgAndArgs ...interface{}) { |
| 1886 | if h, ok := t.(tHelper); ok { |
| 1887 | h.Helper() |
| 1888 | } |
| 1889 | if assert.Same(t, expected, actual, msgAndArgs...) { |
| 1890 | return |
| 1891 | } |
| 1892 | t.FailNow() |
| 1893 | } |
| 1894 | |
| 1895 | // Samef asserts that two pointers reference the same object. |
| 1896 | // |