运行命令
sudo go get github.com/hanwen/go-mtpfs
我得到以下输出:
/usr/lib/go/src/pkg/github.com/hanwen/go-fuse/fuse/bufferpool.go:41: undefined: sync.Pool
/usr/lib/go/src/pkg/github.com/hanwen/go-fuse/fuse/bufferpool.go:54: undefined: sync.Pool
/usr/lib/go/src/pkg/github.com/hanwen/go-fuse/fuse/server.go:44: undefined: sync.Pool
/usr/lib/go/src/pkg/github.com/hanwen/go-fuse/fuse/server.go:47: undefined: sync.Pool
这是什么意思?我该如何解决这个问题?
最佳答案
错误消息意味着 go-fuse
库使用了在 Go 1.3 中引入的 sync.Pool
(该版本的更改:https://golang.org/doc/go1.3)和我怀疑您在系统上安装的 Go 版本较旧(例如,在 Debian stable (wheezy) 上是 1.0.2)。为了使用 go-fuse
库,您需要使用至少 1.3 的 Go 版本。
关于安装 go-mtpfs 时出现错误 "undefined: sync.Pool",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26236734/