replace class/subclass with Class type

This commit is contained in:
Sebastian Zagrodzki
2017-04-09 16:41:38 +02:00
parent 6d9ea8e966
commit 3e59eeac6c
5 changed files with 16 additions and 12 deletions

View File

@@ -17,6 +17,7 @@ package usb
// #include <libusb.h>
import "C"
import "strconv"
type Class uint8
@@ -51,7 +52,10 @@ var classDescription = map[Class]string{
}
func (c Class) String() string {
return classDescription[c]
if d, ok := classDescription[c]; ok {
return d
}
return strconv.Itoa(int(c))
}
type DescriptorType uint8