karalabe / hid

Gopher Interface Devices (USB HID)
Other
266 stars 132 forks source link

Fix go mod vendor #31

Closed lionello closed 1 year ago

lionello commented 3 years ago

This works around https://github.com/golang/go/issues/26366 by adding a dummy.go file in required folders. Without this fix, all C and H files will be missing from the vendor folder, causing the build to fail.

For another example, see https://github.com/Hywan/go-ext-wasm/commit/4724910709abd61d86be29dac079c85f660c3595

dolmen commented 2 years ago

Cosmetic suggestion: use the directory name as the dummy package name.

for d in $(find internal -type d); do echo "package $(basename $d)" >"$d/dummy.go"; done
dolmen commented 2 years ago

Well, this doesn't fix the issue.

Here is what we get with go build: C source files not allowed when not using cgo or SWIG