chore: sync dependencies and format code

This commit is contained in:
Zach Kelling
2026-02-04 15:50:02 -08:00
parent b68b9900b3
commit 3785fa1f1f
5 changed files with 11 additions and 6 deletions
+1 -1
View File
@@ -1,3 +1,3 @@
module github.com/luxfi/hid
go 1.24.0
go 1.25.5
+1
View File
@@ -4,6 +4,7 @@
// 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.
//go:build (!linux && !darwin && !windows) || ios || !cgo
// +build !linux,!darwin,!windows ios !cgo
package hid
+7 -5
View File
@@ -4,6 +4,7 @@
// This file is released under the 3-clause BSD license. Note however that Linux
// support depends on libusb, released under LGNU GPL 2.1 or later.
//go:build (linux && cgo) || (darwin && !ios && cgo) || (windows && cgo)
// +build linux,cgo darwin,!ios,cgo windows,cgo
package hid
@@ -54,8 +55,9 @@ import (
// for enumeration, causing crashes if called concurrently.
//
// For more details, see:
// https://developer.apple.com/documentation/iokit/1438371-iohidmanagersetdevicematching
// > "subsequent calls will cause the hid manager to release previously enumerated devices"
//
// https://developer.apple.com/documentation/iokit/1438371-iohidmanagersetdevicematching
// > "subsequent calls will cause the hid manager to release previously enumerated devices"
var enumerateLock sync.Mutex
// Supported returns whether this platform is supported by the HID library or not.
@@ -67,9 +69,9 @@ func Supported() bool {
// Enumerate returns a list of all the HID devices attached to the system which
// match the vendor and product id:
// - If the vendor id is set to 0 then any vendor matches.
// - If the product id is set to 0 then any product matches.
// - If the vendor and product id are both 0, all HID devices are returned.
// - If the vendor id is set to 0 then any vendor matches.
// - If the product id is set to 0 then any product matches.
// - If the vendor and product id are both 0, all HID devices are returned.
func Enumerate(vendorID uint16, productID uint16) []DeviceInfo {
enumerateLock.Lock()
defer enumerateLock.Unlock()
+1
View File
@@ -6,6 +6,7 @@
// The vendored file is licensed under the 3-clause BSD license, according to:
// https://github.com/orofarne/gowchar/blob/master/LICENSE
//go:build !ios && (linux || darwin || windows)
// +build !ios
// +build linux darwin windows
+1
View File
@@ -6,6 +6,7 @@
// The vendored file is licensed under the 3-clause BSD license, according to:
// https://github.com/orofarne/gowchar/blob/master/LICENSE
//go:build !ios && (linux || darwin || windows)
// +build !ios
// +build linux darwin windows