Skip to content

Commit 808eba1

Browse files
committed
1. add an item .idea in .gitignore
2. add nil check for funk.IsIteratee 3. add an unit test for 2
1 parent fbae87f commit 808eba1

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@ _testmain.go
2222
*.exe
2323
*.test
2424
*.prof
25+
26+
#GoLand
27+
.idea

helpers.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,9 @@ func NotEqual(expected interface{}, actual interface{}) bool {
129129
// IsIteratee returns if the argument is an iteratee.
130130
func IsIteratee(in interface{}) bool {
131131
arrType := reflect.TypeOf(in)
132+
if arrType == nil {
133+
return false
134+
}
132135

133136
kind := arrType.Kind()
134137

helpers_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,3 +263,9 @@ func TestAll(t *testing.T) {
263263
is.False(All("", nil, false))
264264
is.True(All("foo", true, 3))
265265
}
266+
267+
func TestIsIteratee(t *testing.T) {
268+
is := assert.New(t)
269+
270+
is.False(IsIteratee(nil))
271+
}

0 commit comments

Comments
 (0)