Uh oh!
There was an error while loading. Please reload this page.
Add demo 'disk show' command to show human friendly output, sort partition output. - #62
Conversation
In Details() output, partitions were not guaranteed in any order. This puts them in partition number order. Note that that is not necessarily the order on disk.
Demo disk show prints the human friendly version of 'demo disk scan'.
Codecov Report
@@ Coverage Diff @@## master #62 +/- ##
==========================================
+ Coverage 56.54% 56.61% +0.07%
==========================================
Files 15 15 Lines 1657 1662 +5 ==========================================
+ Hits 937 941 +4
Misses 651 651 - Partials 69 70 +1
Continue to review full report at Codecov.
|
| pNums = append(pNums, n) | ||
| } | ||
| sort.Slice(pNums, func(i, j int) bool { return pNums[i] < pNums[j] }) |
There was a problem hiding this comment.
lgtm, you could save yourself this dance if you used an int with IntSlice: https://golang.org/pkg/sort/#IntSlice
Not sure if you really need uint or not.
There was a problem hiding this comment.
yeah, but I don't have an int. maybe I was being pedantic, but a partition number is an unsigned int, because it can't be < 0. (0 <= n <= 127 ... I think 127).
So I think this is about the shortest dance I can do to sort that.
2 things here: