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

reflect.Value has no field or method IsZero #154

Closed
iancboswell opened this issue Jul 16, 2020 · 3 comments
Closed

reflect.Value has no field or method IsZero #154

iancboswell opened this issue Jul 16, 2020 · 3 comments

Comments

@iancboswell
Copy link

I'm getting this error after updating to the most recent version of mergo:

imdario/mergo/merge.go:268:25: newSlice.Index(i).IsZero undefined (type reflect.Value has no field or method IsZero)

My Go version is 1.12.15. I'm wondering if IsZero was added into a more recent version of Go? Any chance this part of the codebase can be backwards-compatible somehow? Or is something else at play here? Checking out 4d20b46 gets rid of the problem for me.

@darccio
Copy link
Owner

darccio commented Jul 16, 2020

@iancboswell It appears in Go 1.13: golang/go#7501

A simple way to keep backward compatibility would be copying the function reflect.IsZero as it was implemented in 1.13: https://go-review.googlesource.com/c/go/+/171337/9/src/reflect/value.go

@darccio
Copy link
Owner

darccio commented Jul 17, 2020

Closing the issue as the code using IsZero is gone after reverting PR #105. I'll take into account for future PRs to keep backward compatibility.

In any case, keep in mind that the official support policy of Go is to keep the last two major releases. Go 1.13 is no longer supported by the Go team.

@darccio darccio closed this as completed Jul 17, 2020
@iancboswell
Copy link
Author

Thanks! Noted re: Go major versions, though I actually have to run on an even older version of Go (1.12) when I deploy to Google App Engine. They do have an issue with not keeping up to date generally, but I don't think that kind of production scenario is uncommon.

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

2 participants