-
Notifications
You must be signed in to change notification settings - Fork 950
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
refactor: modify output formatting of info command #2592
refactor: modify output formatting of info command #2592
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2592 +/- ##
========================================
- Coverage 69.4% 69.3% -0.1%
========================================
Files 279 279
Lines 18825 18825
========================================
- Hits 13065 13047 -18
- Misses 4287 4303 +16
- Partials 1473 1475 +2
|
We found this is your first time to contribute to Pouch, @ihac |
fmt.Fprintf(os.Stdout, "Name: %s\n", info.Name) | ||
fmt.Fprintf(os.Stdout, "Server Version: %s\n", info.ServerVersion) | ||
fmt.Fprintf(os.Stdout, "Storage Driver: %s\n", info.Driver) | ||
fmt.Fprintf(os.Stdout, "Driver Status: %v\n", info.DriverStatus) |
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.
Would it be better to print a list of items one by one?
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.
Well, I think we can use loop to print each item in list. However, I don't know how to use the field by integration side. We need to know the usage before changing the behavior.
22e65f6
to
9ac39cc
Compare
Signed-off-by: Xiao An <hac@zju.edu.cn>
9ac39cc
to
0bc361d
Compare
Well, the PR remind me that if we can change |
For the update this pr involved, LGTM |
Signed-off-by: Xiao An hac@zju.edu.cn
Ⅰ. Describe what this PR did
Remove redundant spaces by refactoring output formatting of
pouch info
subcommand.E.g.,
fmt.Fprintln(os.Stdout, "Containers: ", info.Containers)
:since
fmt.Fprintln()
insert spaces between operands automatically, there will be 2 spaces between "Containers:" and the number of containers. Besides, I think using string formatting (fmt.Fprintf
) would be a little bit more intuitive than string concatenation.Ⅱ. Does this pull request fix one issue?
No.
Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)
No need.
Ⅳ. Describe how to verify it
No need.
Ⅴ. Special notes for reviews