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

Fix error message formatting #2615

Merged
merged 2 commits into from
Feb 7, 2019
Merged

Fix error message formatting #2615

merged 2 commits into from
Feb 7, 2019

Conversation

CodeLingoBot
Copy link
Contributor

Use CodeLingo to automatically fix function comments following the
Code Review Comments guidelines.

This patch was generated by running the CodeLingo Rewrite Flow over the "go-error-fmt" Tenet. Note: the same Tenet can be used to automate PR reviews and generate contributor docs.

Install CodeLingo to drive Continuous Higher Standards

Learn about CodeLingo

Copy link
Contributor

@menghanl menghanl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix.

Some of them are false positives. Can you revert them? Thanks!

@@ -355,7 +355,7 @@ func (s) TestCZServerSocketRegistrationAndDeletion(t *testing.T) {

ns, end := channelz.GetServerSockets(ss[0].ID, startID, c.max)
if int64(len(ns)) != c.length || end != c.end {
return false, fmt.Errorf("GetServerSockets(%d) = %+v (len of which: %d), end: %+v, want len(GetServerSockets(%d)) = %d, end: %+v", c.start, ns, len(ns), end, c.start, c.length, c.end)
return false, fmt.Errorf("getServerSockets(%d) = %+v (len of which: %d), end: %+v, want len(GetServerSockets(%d)) = %d, end: %+v", c.start, ns, len(ns), end, c.start, c.length, c.end)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert this. GetServerSockets is the function name.

@@ -1320,14 +1320,14 @@ func (s) TestCZSocketGetSecurityValueTLS(t *testing.T) {
return false, fmt.Errorf("the SocketData.Security is of type: %T, want: *credentials.TLSChannelzSecurityValue", skt.SocketData.Security)
}
if !reflect.DeepEqual(securityVal.RemoteCertificate, cert.Certificate[0]) {
return false, fmt.Errorf("SocketData.Security.RemoteCertificate got: %v, want: %v", securityVal.RemoteCertificate, cert.Certificate[0])
return false, fmt.Errorf("socketData.Security.RemoteCertificate got: %v, want: %v", securityVal.RemoteCertificate, cert.Certificate[0])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert. SocketData is the field name.

@@ -312,7 +312,7 @@ func (s) TestHealthCheckWithGoAway(t *testing.T) {
// make some rpcs to make sure connection is working.
if err := verifyResultWithDelay(func() (bool, error) {
if _, err := tc.EmptyCall(context.Background(), &testpb.Empty{}); err != nil {
return false, fmt.Errorf("TestService/EmptyCall(_, _) = _, %v, want _, <nil>", err)
return false, fmt.Errorf("testService/EmptyCall(_, _) = _, %v, want _, <nil>", err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert this file. TestService is the service name.

@@ -222,7 +222,7 @@ func (rcw *rawConnWrapper) wantAnyFrame() (http2.Frame, error) {
func (rcw *rawConnWrapper) encodeHeaderField(k, v string) error {
err := rcw.hpackEnc.WriteField(hpack.HeaderField{Name: k, Value: v})
if err != nil {
return fmt.Errorf("HPACK encoding error for %q/%q: %v", k, v, err)
return fmt.Errorf("hPACK encoding error for %q/%q: %v", k, v, err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert HPACK.

@mullikine
Copy link

Hi @menghanl ,

Shane from CodeLingo here. We stuffed up, sorry.

We made an error when writing a Tenet that was used on your repository that resulted in incorrect changes to your code in some edge cases. We've fixed the bug and improved our internal process to prevent this happening again.

We're keen to learn how we can best help dev teams without getting in your way. Your feedback would really help us, my email's [email protected].

Thanks,
Shane & the CodeLingo Team

@menghanl menghanl merged commit c2f12b8 into grpc:master Feb 7, 2019
@dfawley dfawley added the Type: Documentation Documentation or examples label Feb 7, 2019
@dfawley dfawley added this to the 1.19 Release milestone Feb 7, 2019
@Daanikus Daanikus mentioned this pull request Feb 21, 2019
@menghanl menghanl changed the title Fix error formatting based on best practices from Code Review Comments lint: fix error formatting Feb 26, 2019
@menghanl menghanl changed the title lint: fix error formatting Fix error message formatting Feb 26, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Aug 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Type: Documentation Documentation or examples
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants