-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
pemfile: Make test happy with Go1.16 #4164
Conversation
Go1.16 adds a new unexported field to x509.CertPool which causes our tests to fail because cmp.Equal() isn't happy. This change introduces a helper function which compares certprovider.KeyMaterial in a way that makes the test happy with the new Go version.
@@ -55,6 +56,29 @@ func Test(t *testing.T) { | |||
grpctest.RunSubTests(t, s{}) | |||
} | |||
|
|||
func compareKeyMaterial(got, want *certprovider.KeyMaterial) error { | |||
// TODO(easwars): Remove all references to reflect.DeepEqual and use | |||
// cmp.Equal instead. Currently, the later panics because x509.Certificate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: "latter"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed the comment since I have switched to cmp.Equal()
with a nil
check.
// type defines an Equal method, but does not check for nil. This has been | ||
// fixed in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we do a manual check for nil
in the meantime, then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Go1.16 adds a new unexported field to x509.CertPool which causes our
tests to fail because cmp.Equal() isn't happy. This change introduces a
helper function which compares certprovider.KeyMaterial in a way that
makes the test happy with the new Go version.
Fixes #4162