IgnoreInterfaces returns an [cmp.Option] that ignores all values or references of values assignable to certain interface types. These interfaces are specified by passing in an anonymous struct with the interface types embedded in it. For example, to ignore [sync.Locker], pass in struct{sync.Locker}{
(ifaces interface{})
| 64 | // by passing in an anonymous struct with the interface types embedded in it. |
| 65 | // For example, to ignore [sync.Locker], pass in struct{sync.Locker}{}. |
| 66 | func IgnoreInterfaces(ifaces interface{}) cmp.Option { |
| 67 | tf := newIfaceFilter(ifaces) |
| 68 | return cmp.FilterPath(tf.filter, cmp.Ignore()) |
| 69 | } |
| 70 | |
| 71 | type ifaceFilter []reflect.Type |
| 72 |