forked from microsoft/azure-vhd-utils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hostOsType.go
32 lines (27 loc) · 841 Bytes
/
hostOsType.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package footer
import "fmt"
// HostOsType represents the host operating system a disk image is created on.
// Value is stored in the footer in big-endian format.
//
type HostOsType uint32
const (
// HostOsTypeNone represents a nil host OS type
HostOsTypeNone HostOsType = 0
// HostOsTypeWindows represents a Windows OS type
HostOsTypeWindows HostOsType = 0x5769326B
// HostOsTypeMacintosh represents a MAC OS type
HostOsTypeMacintosh HostOsType = 0x4D616320
)
// String returns the string representation of the HostOsType. If the int type
// value does not match with the predefined OS types then this function convert
// the int to string and return
//
func (h HostOsType) String() string {
switch h {
case HostOsTypeWindows:
return "Windows"
case HostOsTypeMacintosh:
return "Macintosh"
}
return fmt.Sprintf("%d", h)
}