t.Errorf("got %v, want %v", X86_64_RELOC_BRANCH.GoString(), "macho.X86_64_RELOC_BRANCH")
}
}
+
+func TestTypeString(t *testing.T) {
+ if TypeExec.String() != "Exec" {
+ t.Errorf("got %v, want %v", TypeExec.String(), "Exec")
+ }
+ if TypeExec.GoString() != "macho.Exec" {
+ t.Errorf("got %v, want %v", TypeExec.GoString(), "macho.Exec")
+ }
+}
TypeBundle Type = 8
)
+var typeStrings = []intName{
+ {uint32(TypeObj), "Obj"},
+ {uint32(TypeExec), "Exec"},
+ {uint32(TypeDylib), "Dylib"},
+ {uint32(TypeBundle), "Bundle"},
+}
+
+func (t Type) String() string { return stringName(uint32(t), typeStrings, false) }
+func (t Type) GoString() string { return stringName(uint32(t), typeStrings, true) }
+
// A Cpu is a Mach-O cpu type.
type Cpu uint32