Skip to content

Commit

Permalink
Add UNKNOWN to PartTableType
Browse files Browse the repository at this point in the history
  • Loading branch information
blp1526 committed Feb 2, 2019
1 parent 5db89ec commit 9aa00fd
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion blk/blk.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,15 @@ func GetPartTableType(majorMinor string) (string, error) {
for _, line := range lines {
prefix := "E:ID_PART_TABLE_TYPE="
if strings.HasPrefix(line, prefix) {
return strings.TrimPrefix(line, prefix), nil
rawName := strings.TrimPrefix(line, prefix)
switch rawName {
case "dos":
return "MBR", nil
case "gpt":
return "GPT", nil
default:
return "UNKNOWN", nil
}
}
}

Expand Down

0 comments on commit 9aa00fd

Please sign in to comment.