fix macos build when fuse is enabled
Instead of trying to export the `errNeedFuseVersion` type, just use string matching. It's good enough for testing and the alternative was annoying. License: MIT Signed-off-by: Steven Allen <steven@stebalien.com>
Steven Allen committed
Apr 18, 2019 at 18:10 UTC
a3bdfd68de2b7307c25915566f1a0a35c3cf294a
3 files changed
+2
-5
fuse/node/mount_nofuse.go
-2
@@ -8,8 +8,6 @@ import (
8
core "github.com/ipfs/go-ipfs/core"
9
)
10
11
-type errNeedFuseVersion error // used in tests, needed in OSX
12
-
11
func Mount(node *core.IpfsNode, fsdir, nsdir string) error {
12
return errors.New("not compiled in")
13
}
fuse/node/mount_test.go
+2
-1
@@ -5,6 +5,7 @@ package node
5
import (
6
"io/ioutil"
7
"os"
8
+ "strings"
9
"testing"
10
"time"
11
@@ -63,7 +64,7 @@ func TestExternalUnmount(t *testing.T) {
64
mkdir(t, ipnsDir)
65
66
err = Mount(node, ipfsDir, ipnsDir)
66
- if _, ok := err.(errNeedFuseVersion); ok || err == fuse.ErrOSXFUSENotFound {
67
+ if strings.Contains(err.Error(), "unable to check fuse version") || err == fuse.ErrOSXFUSENotFound {
68
t.Skip(err)
69
}
70
if err != nil {
fuse/node/mount_unix.go
-2
@@ -30,8 +30,6 @@ var platformFuseChecks = func(*core.IpfsNode) error {
30
return nil
31
}
32
33
-type errNeedFuseVersion error // used in tests, needed in OSX
34
-
33
func Mount(node *core.IpfsNode, fsdir, nsdir string) error {
34
// check if we already have live mounts.
35
// if the user said "Mount", then there must be something wrong.