curatedpackages/packageclient: idiomatic go Writer
The DisplayPackages and DisplayConfigurationOptions functions are modified to take an io.Writer into which they'll write. This better conforms with go idioms, makes testing easier, and will make it easier to add CLI flags to write to a file in the future.
In the process of doing so, a customized tabwriter is implemented to make working with tabwriter more uniform. Helpers for instantiation and writing a table from a 2-D slice of strings make the code easier to read, and should make changes to the output less error prone (less fiddling with '\t' and other spacings).
Issue #, if available:
Description of changes:
Testing (if applicable):
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: To complete the pull request process, please ask for approval from ewollesen after the PR has been reviewed.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
Codecov Report
Merging #2825 (4f81883) into main (cda1fb1) will decrease coverage by
0.06%. The diff coverage is0.00%.
@@ Coverage Diff @@
## main #2825 +/- ##
==========================================
- Coverage 60.49% 60.43% -0.07%
==========================================
Files 319 320 +1
Lines 26287 26314 +27
==========================================
Hits 15902 15902
- Misses 9076 9103 +27
Partials 1309 1309
| Impacted Files | Coverage Δ | |
|---|---|---|
| pkg/curatedpackages/configurationclient.go | 84.61% <0.00%> (ø) |
|
| pkg/curatedpackages/cptabwriter.go | 0.00% <0.00%> (ø) |
|
| pkg/curatedpackages/packageclient.go | 77.45% <0.00%> (-2.31%) |
:arrow_down: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update cda1fb1...4f81883. Read the comment docs.
replaced by #3533