Files
hid/hid_test.go
zeekayandHanzo Dev 622d9d7c7a Go 1.27.1, and the code it can say more simply
Modules declare go 1.27.1 and the build images follow. go fix applied the
modernizers; omitzero is not applied, since it changes what the JSON says.

Co-authored-by: Hanzo Dev <[email protected]>
2026-09-16 18:47:48 -07:00

29 lines
613 B
Go

// hid - Gopher Interface Devices (USB HID)
// Copyright (c) 2017 Péter Szilágyi. All rights reserved.
//
// This file is released under the 3-clause BSD license. Note however that Linux
// support depends on libusb, released under GNU LGPL 2.1 or later.
package hid
import (
"sync"
"testing"
)
// Tests that device enumeration can be called concurrently from multiple threads.
func TestThreadedEnumerate(t *testing.T) {
var pend sync.WaitGroup
for i := range 8 {
pend.Add(1)
go func(index int) {
defer pend.Done()
for range 512 {
Enumerate(uint16(index), 0)
}
}(i)
}
pend.Wait()
}