From 9777e4bf7ea2aa75ab443dc6e15c42103eb6b027 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sun, 23 Apr 2017 00:06:56 +0200 Subject: [PATCH] Fix Flock build breakage go-fuse has added a new method to the nodefs.File interface that caused this build error: internal/fusefrontend/file.go:75: cannot use file literal (type *file) as type nodefs.File in return argument: *file does not implement nodefs.File (missing Flock method) Fixes https://github.com/rfjakob/gocryptfs/issues/104 and prevents the problem from happening again. --- internal/fusefrontend/file.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/fusefrontend/file.go b/internal/fusefrontend/file.go index 6096501..84ce058 100644 --- a/internal/fusefrontend/file.go +++ b/internal/fusefrontend/file.go @@ -52,6 +52,10 @@ type file struct { lastOpCount uint64 // Parent filesystem fs *FS + // We embed a nodefs.NewDefaultFile() that returns ENOSYS for every operation we + // have not implemented. This prevents build breakage when the go-fuse library + // adds new methods to the nodefs.File interface. + nodefs.File } // NewFile returns a new go-fuse File instance. @@ -73,6 +77,7 @@ func NewFile(fd *os.File, writeOnly bool, fs *FS) (nodefs.File, fuse.Status) { fileTableEntry: t, loopbackFile: nodefs.NewLoopbackFile(fd), fs: fs, + File: nodefs.NewDefaultFile(), }, fuse.OK }