Closed nsajko closed 5 years ago
this is what I see:
[hanwen@localhost go-mtpfs]$ go clean -modcache
[hanwen@localhost go-mtpfs]$ go test ./...
go: finding github.com/hanwen/go-fuse v1.0.0
go: finding github.com/hanwen/go-fuse/v2 v2.0.2
go: finding github.com/kylelemons/godebug v1.1.0
go: finding github.com/hanwen/usb v0.0.0-20141217151552-69aee4530ac7
go: finding golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456
go: finding golang.org/x/sys v0.0.0-20180830151530-49385e6e1522
go: finding github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348
go: downloading github.com/hanwen/go-fuse v1.0.0
go: downloading github.com/hanwen/usb v0.0.0-20141217151552-69aee4530ac7
go: extracting github.com/hanwen/usb v0.0.0-20141217151552-69aee4530ac7
go: extracting github.com/hanwen/go-fuse v1.0.0
go: downloading github.com/hanwen/go-fuse/v2 v2.0.2
go: extracting github.com/hanwen/go-fuse/v2 v2.0.2
go: downloading golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456
go: extracting golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456
# github.com/hanwen/usb
cgo-gcc-prolog: In function ‘_cgo_afe072e410cc_Cfunc_libusb_set_debug’:
cgo-gcc-prolog:661:2: warning: ‘libusb_set_debug’ is deprecated: Use libusb_set_option instead [-Wdeprecated-declarations]
In file included from ../../go/pkg/mod/github.com/hanwen/usb@v0.0.0-20141217151552-69aee4530ac7/usb.go:8:
/usr/include/libusb-1.0/libusb.h:1300:18: note: declared here
1300 | void LIBUSB_CALL libusb_set_debug(libusb_context *ctx, int level);
| ^~~~~~~~~~~~~~~~
? github.com/hanwen/go-mtpfs [no test files]
--- FAIL: TestReadBlockBoundaryAndroid (0.00s)
device_test.go:35: SelectDevice failed: no MTP devices found
--- FAIL: TestReadBlockBoundaryNormal (0.00s)
device_test.go:35: SelectDevice failed: no MTP devices found
--- FAIL: TestAndroid (0.00s)
device_test.go:35: SelectDevice failed: no MTP devices found
--- FAIL: TestNormal (0.00s)
device_test.go:35: SelectDevice failed: no MTP devices found
FAIL
FAIL github.com/hanwen/go-mtpfs/fs 0.017s
--- FAIL: TestAndroid (0.01s)
device_test.go:31: no MTP devices found
--- FAIL: TestDeviceProperties (0.00s)
device_test.go:185: no MTP devices found
--- FAIL: TestDeviceInfo (0.00s)
device_test.go:274: no MTP devices found
--- FAIL: TestDeviceStorage (0.00s)
device_test.go:293: no MTP devices found
FAIL
FAIL github.com/hanwen/go-mtpfs/mtp 0.030s
[hanwen@localhost go-mtpfs]$ pwd
/home/hanwen/vc/go-mtpfs
the paths your compile prints ($GOROOT, $GOPATH) out make me think you are not using modules.
Indeed, the build works with the GO111MODULE environment variable set to "on". Maybe you should put that requirement in the README?
@nsajko can you expand on your fix? I'm getting the same errors
@JRMeyer You need a module-aware Go (I think that is Go 1.11 and up) and set its GO111MODULE environment variable to "on". But I think the latter part may not even be necessary with the newest release, Go 1.13.
I get the same result with Go 1.12.8 as with tip.