-
Notifications
You must be signed in to change notification settings - Fork 161
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
incorrect assumption in mapstructure library causing panic #200
Comments
Sorry, haven't had a chance to study this. Were you able to figure this out? |
currently no time due to private reasons, will come back to this maybe next week. |
the solution is to make the second test pass by updating the |
mapstructure package assumes that when
reflect.Type.Kind() == reflect.String
is true that theninterface{}.(string)
will always succeed.Below two tests, the first one panics due to the above assumption, the second one with a fix attempt that does not panic but still needs some improvements from someone who knows more about reflections.
The problem is that we pass a value type to koanf but the pointer type implements the TextMarshaler interface which we want to use before falling back to simply setting the internal string value.
The
TODO
show where I'm currently struggling...The text was updated successfully, but these errors were encountered: