Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@ninghejun
Copy link
Contributor

@ninghejun ninghejun commented Nov 21, 2019

fix the bug :reflect: call of reflect.Value.Type on zero Value

if the slice is nil, or len==0, will be panic.
the case:

type Foo struct{
	Bar[]int
}

func TestGoFunk(t *testing.T) {
	foo := []Foo{}
	bars := funk.Get(foo, "Bar") //panic !!
	fmt.Print(bars)
}

fix the bug :reflect: call of reflect.Value.Type on zero Value

if the slice is nil, or len==0, will be panic.
the case:

type Foo struct{
	Bar[]int
}

func TestGoFunk(t *testing.T) {
	Log.InitLog()
	foo := []Foo{}
	bars := funk.Get(foo, "Bar") //panic !!
	fmt.Print(bars)
}
@thoas thoas merged commit 3108806 into thoas:master Nov 24, 2019
@thoas
Copy link
Owner

thoas commented Nov 24, 2019

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants