diff --git a/dummy.go b/dummy.go new file mode 100644 index 0000000..f6bbdc3 --- /dev/null +++ b/dummy.go @@ -0,0 +1,25 @@ +// +build dummy + +// This file is part of a workaround for `go mod vendor` which won't vendor +// C files if there's no Go file in the same directory. +// This would prevent the hidapi/hidapi/hidapi.h file to be vendored. +// +// This Go file imports the c directory where there is another dummy.go file which +// is the second part of this workaround. +// +// These two files combined make it so `go mod vendor` behaves correctly. +// +// See this issue for reference: https://github.com/golang/go/issues/26366 + +package main + +import ( + _ "github.com/karalabe/usb/hidapi" + _ "github.com/karalabe/usb/hidapi/hidapi" + _ "github.com/karalabe/usb/hidapi/libusb" + _ "github.com/karalabe/usb/hidapi/mac" + _ "github.com/karalabe/usb/hidapi/windows" + _ "github.com/karalabe/usb/libusb" + _ "github.com/karalabe/usb/libusb/libusb" + _ "github.com/karalabe/usb/libusb/libusb/os" +) diff --git a/hidapi/dummy.go b/hidapi/dummy.go new file mode 100644 index 0000000..647380f --- /dev/null +++ b/hidapi/dummy.go @@ -0,0 +1,7 @@ +// +build dummy + +// Package c contains only a C file. +// +// This Go file is part of a workaround for `go mod vendor`. +// Please see the file dummy.go at the root of the module for more information. +package hidapi diff --git a/hidapi/hidapi/dummy.go b/hidapi/hidapi/dummy.go new file mode 100644 index 0000000..647380f --- /dev/null +++ b/hidapi/hidapi/dummy.go @@ -0,0 +1,7 @@ +// +build dummy + +// Package c contains only a C file. +// +// This Go file is part of a workaround for `go mod vendor`. +// Please see the file dummy.go at the root of the module for more information. +package hidapi diff --git a/hidapi/libusb/dummy.go b/hidapi/libusb/dummy.go new file mode 100644 index 0000000..20d44a7 --- /dev/null +++ b/hidapi/libusb/dummy.go @@ -0,0 +1,7 @@ +// +build dummy + +// Package c contains only a C file. +// +// This Go file is part of a workaround for `go mod vendor`. +// Please see the file dummy.go at the root of the module for more information. +package libusb diff --git a/hidapi/mac/dummy.go b/hidapi/mac/dummy.go new file mode 100644 index 0000000..9e519ac --- /dev/null +++ b/hidapi/mac/dummy.go @@ -0,0 +1,7 @@ +// +build dummy + +// Package c contains only a C file. +// +// This Go file is part of a workaround for `go mod vendor`. +// Please see the file dummy.go at the root of the module for more information. +package mac diff --git a/hidapi/windows/dummy.go b/hidapi/windows/dummy.go new file mode 100644 index 0000000..d72069e --- /dev/null +++ b/hidapi/windows/dummy.go @@ -0,0 +1,7 @@ +// +build dummy + +// Package c contains only a C file. +// +// This Go file is part of a workaround for `go mod vendor`. +// Please see the file dummy.go at the root of the module for more information. +package windows diff --git a/libusb/dummy.go b/libusb/dummy.go new file mode 100644 index 0000000..20d44a7 --- /dev/null +++ b/libusb/dummy.go @@ -0,0 +1,7 @@ +// +build dummy + +// Package c contains only a C file. +// +// This Go file is part of a workaround for `go mod vendor`. +// Please see the file dummy.go at the root of the module for more information. +package libusb diff --git a/libusb/libusb/dummy.go b/libusb/libusb/dummy.go new file mode 100644 index 0000000..20d44a7 --- /dev/null +++ b/libusb/libusb/dummy.go @@ -0,0 +1,7 @@ +// +build dummy + +// Package c contains only a C file. +// +// This Go file is part of a workaround for `go mod vendor`. +// Please see the file dummy.go at the root of the module for more information. +package libusb diff --git a/libusb/libusb/os/dummy.go b/libusb/libusb/os/dummy.go new file mode 100644 index 0000000..7605504 --- /dev/null +++ b/libusb/libusb/os/dummy.go @@ -0,0 +1,7 @@ +// +build dummy + +// Package c contains only a C file. +// +// This Go file is part of a workaround for `go mod vendor`. +// Please see the file dummy.go at the root of the module for more information. +package os