-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Fix a panic when comparing types where the underlying type is string #622
Conversation
The code was checking if the type's _kind_ was string and then attempting to do a type assertion of `var.(string)`. However, this assertion only works if the type actually _is_ a string. If it's some other type (like `type foo string`) then this ends up giving us a runtime panic.
Travis failure is because of #619 |
Ping |
I'm hitting this issue w/ 1.2.2. Any chance we can get this merged? I verified the change fixes it for me as well. |
@georgelesica-wf - the test in that other PR looks to be functionally the same as the one I added, so I'm sure it fixes the issue as best as I could test it. I don't have any other code that causes this issue to run the PR branch against. |
Cool, thanks! Would you have any objection if we merged the one I linked? I won't close this one until that's done, however. |
Yeah, I'm fine with anything that fixes this bug. |
Perhaps I'm little bit late to the party, tried to fix it too in #674 |
This was fixed a while back in a different commit. |
The code was checking if the type's kind was string and then attempting to
do a type assertion of
var.(string)
. However, this assertion only works ifthe type actually is a string. If it's some other type (like
type foo string
) then this ends up giving us a runtime panic.