File tree 1 file changed +10
-0
lines changed
1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -303,6 +303,11 @@ func Nil[T any](p *T, a ...any) {
303
303
304
304
// INil asserts that the interface value IS nil. If it is it panics/errors
305
305
// (default Asserter) with the given message.
306
+ //
307
+ // Note, use this only for real interface types. Go's interface's has two values
308
+ // so this won't work e.g. slices! Read more information about interface type.
309
+ //
310
+ // https://go.dev/doc/faq#nil_error
306
311
func INil (i any , a ... any ) {
307
312
if i != nil {
308
313
defMsg := assertionMsg + ": interface should be nil"
@@ -312,6 +317,11 @@ func INil(i any, a ...any) {
312
317
313
318
// INotNil asserts that the interface value is NOT nil. If it is it
314
319
// panics/errors (default Asserter) with the given message.
320
+ //
321
+ // Note, use this only for real interface types. Go's interface's has two values
322
+ // so this won't work e.g. slices! Read more information about interface type.
323
+ //
324
+ // https://go.dev/doc/faq#nil_error
315
325
func INotNil (i any , a ... any ) {
316
326
if i == nil {
317
327
defMsg := assertionMsg + ": interface shouldn't be nil"
You can’t perform that action at this time.
0 commit comments