emptyInterface creates a new instance of the object sent It the returned interface is writable and contains the zero value.
(a interface{})
| 250 | // emptyInterface creates a new instance of the object sent |
| 251 | // It the returned interface is writable and contains the zero value. |
| 252 | func emptyInterface(a interface{}) interface{} { |
| 253 | aval := reflect.ValueOf(a) |
| 254 | indirect := reflect.Indirect(aval) |
| 255 | newIndirect := reflect.New(indirect.Type()) |
| 256 | |
| 257 | return newIndirect.Interface() |
| 258 | } |
| 259 | func testType(t *testing.T, base interface{}, ff interface{}) { |
| 260 | require.Implements(t, (*json.Marshaler)(nil), ff) |
| 261 | require.Implements(t, (*json.Unmarshaler)(nil), ff) |
no outgoing calls
no test coverage detected
searching dependent graphs…