Skip to content

Commit

Permalink
godoc added
Browse files Browse the repository at this point in the history
  • Loading branch information
mattcorby-eaglen committed Apr 5, 2023
1 parent d65cd7c commit 2b58e84
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion is/nil.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

var description = "value that is <nil>"

// Nil matches if the actual value is nil
// Nil matches if the actual error value is nil
func Nil() *gocrest.Matcher[error] {
match := new(gocrest.Matcher[error])
match.Describe = description
Expand All @@ -17,6 +17,8 @@ func Nil() *gocrest.Matcher[error] {
}
return match
}

// NilArray matches if the actual array value is nil
func NilArray[A any]() *gocrest.Matcher[[]A] {
match := new(gocrest.Matcher[[]A])
match.Describe = description
Expand All @@ -26,6 +28,8 @@ func NilArray[A any]() *gocrest.Matcher[[]A] {
}
return match
}

// NilMap matches if the actual map value is nil
func NilMap[K comparable, V any]() *gocrest.Matcher[map[K]V] {
match := new(gocrest.Matcher[map[K]V])
match.Describe = description
Expand All @@ -35,6 +39,8 @@ func NilMap[K comparable, V any]() *gocrest.Matcher[map[K]V] {
}
return match
}

// NilPtr matches if the actual pointer to T is nil
func NilPtr[T any]() *gocrest.Matcher[*T] {
match := new(gocrest.Matcher[*T])
match.Describe = description
Expand Down

0 comments on commit 2b58e84

Please sign in to comment.