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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions balancer/grpclb/grpclb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ func newLoadBalancer(numberOfBackends int) (tss *testServers, cleanup func(), er
// Start a backend.
beLis, e := net.Listen("tcp", "localhost:0")
if e != nil {
err = fmt.Errorf("Failed to listen %v", err)
err = fmt.Errorf("failed to listen %v", err)
return
}
beIPs = append(beIPs, beLis.Addr().(*net.TCPAddr).IP)
Expand All @@ -323,7 +323,7 @@ func newLoadBalancer(numberOfBackends int) (tss *testServers, cleanup func(), er
// Start a load balancer.
lbLis, err := net.Listen("tcp", "localhost:0")
if err != nil {
err = fmt.Errorf("Failed to create the listener for the load balancer %v", err)
err = fmt.Errorf("failed to create the listener for the load balancer %v", err)
return
}
lbCreds := &serverNameCheckCreds{
Expand Down
2 changes: 1 addition & 1 deletion balancer/roundrobin/roundrobin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func startTestServers(count int) (_ *test, err error) {
for i := 0; i < count; i++ {
lis, err := net.Listen("tcp", "localhost:0")
if err != nil {
return nil, fmt.Errorf("Failed to listen %v", err)
return nil, fmt.Errorf("failed to listen %v", err)
}

s := grpc.NewServer()
Expand Down
4 changes: 2 additions & 2 deletions balancer_switching_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func checkPickFirst(cc *ClientConn, servers []*server) error {
for i := 0; i < 3; i++ {
err = cc.Invoke(context.Background(), "/foo/bar", &req, &reply)
if errorDesc(err) != servers[0].port {
return fmt.Errorf("Index %d: want peer %v, got peer %v", i, servers[0].port, err)
return fmt.Errorf("index %d: want peer %v, got peer %v", i, servers[0].port, err)
}
}
return nil
Expand Down Expand Up @@ -122,7 +122,7 @@ func checkRoundRobin(cc *ClientConn, servers []*server) error {
for i := 0; i < 3*serverCount; i++ {
err = cc.Invoke(context.Background(), "/foo/bar", &req, &reply)
if errorDesc(err) != servers[i%serverCount].port {
return fmt.Errorf("Index %d: want peer %v, got peer %v", i, servers[i%serverCount].port, err)
return fmt.Errorf("index %d: want peer %v, got peer %v", i, servers[i%serverCount].port, err)
}
}
return nil
Expand Down
2 changes: 1 addition & 1 deletion picker_wrapper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ type testingPicker struct {

func (p *testingPicker) Pick(ctx context.Context, opts balancer.PickOptions) (balancer.SubConn, func(balancer.DoneInfo), error) {
if atomic.AddInt64(&p.maxCalled, -1) < 0 {
return nil, nil, fmt.Errorf("Pick called to many times (> goroutineCount)")
return nil, nil, fmt.Errorf("pick called to many times (> goroutineCount)")
}
if p.err != nil {
return nil, nil, p.err
Expand Down
2 changes: 1 addition & 1 deletion test/bufconn/bufconn.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ type Listener struct {
done chan struct{}
}

var errClosed = fmt.Errorf("Closed")
var errClosed = fmt.Errorf("closed")

// Listen returns a Listener that can only be contacted by its own Dialers and
// creates buffered connections between the two.
Expand Down
2 changes: 1 addition & 1 deletion test/channelz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1327,7 +1327,7 @@ func (s) TestCZSocketGetSecurityValueTLS(t *testing.T) {
return true, nil
}
}
return false, fmt.Errorf("SocketData.Security.StandardName got: %v, want it to be one of %v ", securityVal.StandardName, cipherSuites)
return false, fmt.Errorf("SocketData.Security.StandardName got: %v, want it to be one of %v", securityVal.StandardName, cipherSuites)
}); err != nil {
t.Fatal(err)
}
Expand Down
2 changes: 1 addition & 1 deletion test/retry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ func (s) TestRetryStreaming(t *testing.T) {
cCheckElapsed := func(d time.Duration) clientOp {
return func(_ testpb.TestService_FullDuplexCallClient) error {
if elapsed := time.Since(curTime); elapsed < d {
return fmt.Errorf("Elapsed time: %v; want >= %v", elapsed, d)
return fmt.Errorf("elapsed time: %v; want >= %v", elapsed, d)
}
return nil
}
Expand Down