Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Map fails when struct has an interface member #100

Closed
alexkursell opened this issue Feb 21, 2019 · 2 comments
Closed

Bug: Map fails when struct has an interface member #100

alexkursell opened this issue Feb 21, 2019 · 2 comments

Comments

@alexkursell
Copy link

alexkursell commented Feb 21, 2019

mergo panics when the following code is run:

type S struct {
	Member interface{}
}

func main(){
	m := make(map[string]interface{})
	m["Member"] = "anything"

	st := &S{}
	mergo.Map(st, m)

	fmt.Printf("%+v", st)
}

producing panic: reflect: call of reflect.Value.IsNil on string Value. This panic occurs if any interface type at all is specified for Member

@alexkursell alexkursell changed the title Bug: "panic: reflect: call of reflect.Value.IsNil on struct Value" Bug: MapWithOverwrite fails when struct has an interface member Feb 21, 2019
@alexkursell alexkursell changed the title Bug: MapWithOverwrite fails when struct has an interface member Bug: Map fails when struct has an interface member Feb 21, 2019
@kidlj
Copy link

kidlj commented Nov 15, 2019

Any update on this?

darccio added a commit that referenced this issue Jul 17, 2020
@darccio
Copy link
Owner

darccio commented Jul 17, 2020

@kidlj Fixed in master.

@darccio darccio closed this as completed Jul 17, 2020
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

No branches or pull requests

3 participants