-
Notifications
You must be signed in to change notification settings - Fork 56
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
many: use new disk.PartitionTableType
instead of string
#1025
Conversation
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.
You missed a few (all under cmd/
it seems).
2654d8c
to
7086d75
Compare
This commit adds json marshal/unmarshal to `PartitionTableType` The reason is that the `otk` utils serialize this type as a JSON. While the json is strictly internal and we make no gurantees about it is still nicer to serialize as strings because otherwise the diff in the json looks something like: ```json @@ -147,7 +147,7 @@ func TestUnmarshalOutput(t *testing.T) { "partition-table": { "Size": 911, "UUID": "", - "Type": "gpt", + "Type": 2, "Partitions": [ { "Start": 0, ``` and it is also nicer for general debug-ability.
This commit makes use of the new `disk.PartitionTableType instead of just using an untyped string (thanks to Achilleas for adding the new type and to Tomáš for suggesting to use it more).
7086d75
to
16564da
Compare
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.
Very nice. Should we do the same for filesystem types?
Also, can you update the top PR comment/description to avoid confusion in the future? |
Yeah, I guess we want this for |
Fine to do in a separate PR. |
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.
Amazing 😍
This commit makes use of the new `disk.PartitionTableType instead of just using an untyped string (thanks to Achilleas for adding the new type and to Tomáš for suggesting to use it more).
disk: add json marshal/unmarshal to
PartitionTableType
This commit adds json marshal/unmarshal to
PartitionTableType
The reason is that the
otk
utils serialize this typeas a JSON. While the json is strictly internal and we make no
gurantees about it is still nicer to serialize as strings because
otherwise the diff in the json looks something like:
and it is also nicer for general debug-ability.