-
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
Simplifications and cleanups (gosimple) #1996
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This fixes: balancer/base/balancer.go:149:2: redundant return statement (S1023) balancer_v1_wrapper.go:260:2: redundant return statement (S1023) balancer_v1_wrapper.go:273:2: redundant return statement (S1023) balancer_v1_wrapper.go:285:2: redundant return statement (S1023) benchmark/benchmark.go:68:2: redundant return statement (S1023) clientconn.go:1461:2: redundant return statement (S1023) grpclb.go:223:2: redundant return statement (S1023) grpclb.go:260:2: redundant return statement (S1023) grpclb_util.go:201:2: redundant return statement (S1023) rpc_util.go:278:50: redundant return statement (S1023) rpc_util.go:296:56: redundant return statement (S1023) rpc_util.go:314:56: redundant return statement (S1023) rpc_util.go:333:53: redundant return statement (S1023) rpc_util.go:354:52: redundant return statement (S1023) rpc_util.go:387:56: redundant return statement (S1023) rpc_util.go:416:53: redundant return statement (S1023) stream.go:651:2: redundant return statement (S1023)
knweiss
changed the title
Simplifications and cleanups
Simplifications and cleanups (gosimple)
Apr 15, 2018
(I've dropped similar gosimple cleanups using time.Until() as this API is not available in go1.6 and go1.7)
This fixes: benchmark/worker/benchmark_client.go:151:36: should use make([]*grpc.ClientConn, connCount) instead (S1019) benchmark/worker/benchmark_client.go:231:47: should use make([]lockingHistogram, rpcCountPerConn * len(conns)) instead (S1019) benchmark/worker/benchmark_client.go:343:39: should use make([]*stats.Histogram, len(bc.lockingHistograms)) instead (S1019) benchmark/worker/benchmark_client.go:369:22: should use make([]uint32, len(mergedHistogram.Buckets)) instead (S1019) encoding/encoding.go:85:47: should use make(map[string]Codec) instead (S1019) proxy_test.go:116:26: should use make([]byte, len(msg)) instead (S1019)
This fixes: clientconn.go:948:3: should write m = cc.sc.Methods[method[:i+1]] instead of m, _ = cc.sc.Methods[method[:i+1]] (S1005) encoding/proto/proto_test.go:43:5: should use !bytes.Equal(p.GetBody(), expectedBody) instead (S1004) resolver/dns/dns_resolver.go:260:2: should merge variable declaration with assignment on next line (S1021) resolver/dns/dns_resolver.go:344:2: should use 'return <expr>' instead of 'if <expr> { return <bool> }; return <bool>' (S1008)
I've removed seven additional gosimple cleanups using |
dfawley
approved these changes
Apr 16, 2018
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.
Thanks for the cleanups!
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Apply various code simplifications and cleanups found by gosimple.
One commit per category. Please see individual commit msgs for details.