From 5150242633072691652472dfb183c7035dca92ab Mon Sep 17 00:00:00 2001 From: Sebastian Zagrodzki Date: Mon, 10 Apr 2017 01:41:12 +0200 Subject: [PATCH] Set slice length, since we don't use append. --- usb/libusb.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usb/libusb.go b/usb/libusb.go index 705e92e..fb4e2b7 100644 --- a/usb/libusb.go +++ b/usb/libusb.go @@ -253,7 +253,7 @@ func (libusbImpl) getDeviceDesc(d *libusbDevice) (*Descriptor, error) { Len: int(alt.bNumEndpoints), Cap: int(alt.bNumEndpoints), } - i.Endpoints = make([]EndpointInfo, 0, len(ends)) + i.Endpoints = make([]EndpointInfo, len(ends)) for n, end := range ends { // TODO(sebek): pass the device descriptor too. i.Endpoints[n] = libusbEndpoint(end).endpointInfo(nil)