@cryptotaxi247 / kubo / commits / 88b5a1a01

path.Join for cross platform goodness

Jeromy committed Feb 23, 2015 at 21:56 UTC 88b5a1a019a2913c6a60b5eeed560d5bfef1c6aa
1 file changed +5 -4
fuse/readonly/ipfs_test.go
+5 -4
@@ -6,6 +6,7 @@ import (
6 //context "github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/go.net/context"
7 "io/ioutil"
8 "os"
9 + "path"
10 "testing"
11
12 fstest "github.com/jbenet/go-ipfs/Godeps/_workspace/src/bazil.org/fuse/fs/fstestutil"
@@ -77,7 +78,7 @@ func TestIpfsBasicRead(t *testing.T) {
78 t.Fatal(err)
79 }
80
80 - fname := mnt.Dir + "/" + k.String()
81 + fname := path.Join(mnt.Dir, k.String())
82 rbuf, err := ioutil.ReadFile(fname)
83 if err != nil {
84 t.Fatal(err)
@@ -116,8 +117,8 @@ func TestIpfsBasicDirRead(t *testing.T) {
117 t.Fatal(err)
118 }
119
119 - dirname := mnt.Dir + "/" + d1ndk.String()
120 - fname := dirname + "/actual"
120 + dirname := path.Join(mnt.Dir, d1ndk.String())
121 + fname := path.Join(dirname, "actual")
122 rbuf, err := ioutil.ReadFile(fname)
123 if err != nil {
124 t.Fatal(err)
@@ -153,7 +154,7 @@ func TestFileSizeReporting(t *testing.T) {
154 t.Fatal(err)
155 }
156
156 - fname := mnt.Dir + "/" + k.String()
157 + fname := path.Join(mnt.Dir, k.String())
158
159 finfo, err := os.Stat(fname)
160 if err != nil {