From 2da2ce1e17e95b1d6767e3d70c32eba538ad5afa Mon Sep 17 00:00:00 2001 From: Kyle Lemons Date: Mon, 26 Mar 2012 22:51:47 -0700 Subject: [PATCH] gofmt --- lsusb/main.go | 2 +- usb/config.go | 6 +++--- usb/descriptor.go | 6 +++--- usb/device.go | 3 ++- usbid/parse.go | 6 +++--- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/lsusb/main.go b/lsusb/main.go index 3edb40b..1da2199 100644 --- a/lsusb/main.go +++ b/lsusb/main.go @@ -1,8 +1,8 @@ package main import ( - "fmt" "flag" + "fmt" "log" "github.com/kylelemons/gousb/usb" diff --git a/usb/config.go b/usb/config.go index 37fc715..2dfb7cf 100644 --- a/usb/config.go +++ b/usb/config.go @@ -32,9 +32,9 @@ func (e Endpoint) Direction() EndpointDirection { func (e Endpoint) String() string { return fmt.Sprintf("Endpoint %d %-3s %s - %s %s", e.Number(), e.Direction(), - TransferType(e.Attributes) & TRANSFER_TYPE_MASK, - IsoSyncType(e.Attributes) & ISO_SYNC_TYPE_MASK, - IsoUsageType(e.Attributes) & ISO_USAGE_TYPE_MASK, + TransferType(e.Attributes)&TRANSFER_TYPE_MASK, + IsoSyncType(e.Attributes)&ISO_SYNC_TYPE_MASK, + IsoUsageType(e.Attributes)&ISO_USAGE_TYPE_MASK, ) } diff --git a/usb/descriptor.go b/usb/descriptor.go index 657d246..a145e51 100644 --- a/usb/descriptor.go +++ b/usb/descriptor.go @@ -9,9 +9,9 @@ type Descriptor struct { Type DescriptorType // The type of this descriptor Spec BCD // USB Specification Release Number - Class uint8 // The class of this device - SubClass uint8 // The sub-class (within the class) of this device - Protocol uint8 // The protocol (within the sub-class) of this device + Class uint8 // The class of this device + SubClass uint8 // The sub-class (within the class) of this device + Protocol uint8 // The protocol (within the sub-class) of this device Vendor ID // The 8-bit Vendor identifer Product ID // The 8-bit Product identifier Device BCD // The device version diff --git a/usb/device.go b/usb/device.go index 3788866..c5659dc 100644 --- a/usb/device.go +++ b/usb/device.go @@ -89,7 +89,8 @@ func (d *Device) Reset() error { return nil } -var ControlTimeout = 5*time.Second +var ControlTimeout = 5 * time.Second + func (d *Device) Control(rType, request uint8, val, idx uint16, data []byte) (int, error) { dataSlice := (*reflect.SliceHeader)(unsafe.Pointer(&data)) n := C.libusb_control_transfer( diff --git a/usbid/parse.go b/usbid/parse.go index 83b1403..5083e97 100644 --- a/usbid/parse.go +++ b/usbid/parse.go @@ -20,7 +20,7 @@ func (v Vendor) String() string { } type Product struct { - Name string + Name string Interface map[usb.ID]string } @@ -29,7 +29,7 @@ func (p Product) String() string { } type Class struct { - Name string + Name string SubClass map[uint8]*SubClass } @@ -38,7 +38,7 @@ func (c Class) String() string { } type SubClass struct { - Name string + Name string Protocol map[uint8]string }