bugfix: fix repeated strings reported by goconst#2454
bugfix: fix repeated strings reported by goconst#2454allencloud merged 2 commits intoAliyunContainerService:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2454 +/- ##
=========================================
Coverage ? 68.87%
=========================================
Files ? 277
Lines ? 18296
Branches ? 0
=========================================
Hits ? 12602
Misses ? 4260
Partials ? 1434
|
7f03c69 to
ffb88e4
Compare
| ) | ||
|
|
||
| const ( | ||
| unknownHostName = "<unknown>" |
There was a problem hiding this comment.
Is there is need to add three different const for "unknown", since they're all same ? Just looks weird
There was a problem hiding this comment.
Yeap, i have thought about this. Although their value are all same, they represent value of different system info field in unknown scene.
There was a problem hiding this comment.
I think it depends on how the three value diverged, it's possible to be different in the future?
There was a problem hiding this comment.
It may be hard to confirm.
|
Maybe We can make verify step more accurate in desc, such as |
| } | ||
|
|
||
| // Action labels for different pod/image operations | ||
| const ( |
There was a problem hiding this comment.
Thanks for your contribution. In fact, the pouch's HTTP server also needs to collect metrics. So could you please to do the samething for api/servers?
2f569c5 to
882e19a
Compare
|
|
||
| // Action labels for different pod/container/image operations. | ||
| const ( | ||
| ActionCreate = "create" |
There was a problem hiding this comment.
How about changing all this const variables' naming to be XXXActionLabel?
I think this will be a little bit more readable.
|
|
||
| const ( | ||
| // PropagationRPrivate represents mount propagation rprivate. | ||
| PropagationRPrivate = "rprivate" |
There was a problem hiding this comment.
How about changing all this const variables' naming to be XXXXXPropagationMode?
I think this will be a little bit more readable.
882e19a to
b16068f
Compare
|
@mathspanda How about you directly adding Then no one needs to fix config.yml and goconst could serve all the following pull request. In addition, does the update satisfy you? @starnop |
Signed-off-by: mathspanda <[email protected]>
Signed-off-by: mathspanda <[email protected]>
b16068f to
f6be76f
Compare
Done. |
|
That is so great to see this fixed in code and add a defender in circleCI. LGTM |
Signed-off-by: mathspanda [email protected]
Ⅰ. Describe what this PR did
Ⅱ. Does this pull request fix one issue?
#2424
Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)
None
Ⅳ. Describe how to verify it
gometalinter --disable-all --skip vendor -E goconst ./...
Ⅴ. Special notes for reviews
None