From 68293568edf304cd97a649ccdd4e4f9f1065572f Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Fri, 19 Apr 2019 12:47:50 -0700 Subject: [PATCH 1/2] fix: use filepath when handling OS paths fixes https://github.com/ipfs/go-ipfs-files/issues/16 --- add.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/add.go b/add.go index b4416292e..811d7bc2c 100644 --- a/add.go +++ b/add.go @@ -4,9 +4,9 @@ import ( "context" "encoding/json" "errors" + "filepath" "io" "os" - "path" "github.com/ipfs/go-ipfs-files" ) @@ -90,7 +90,7 @@ func (s *Shell) AddDir(dir string) (string, error) { if err != nil { return "", err } - slf := files.NewSliceDirectory([]files.DirEntry{files.FileEntry(path.Base(dir), sf)}) + slf := files.NewSliceDirectory([]files.DirEntry{files.FileEntry(filepath.Base(dir), sf)}) reader := files.NewMultiFileReader(slf, true) resp, err := s.Request("add"). From e0d86c94049404aa35b5b2b332702df568f2efe0 Mon Sep 17 00:00:00 2001 From: Dominic Della Valle Date: Fri, 19 Apr 2019 13:06:29 -0700 Subject: [PATCH 2/2] fix import Co-Authored-By: Stebalien --- add.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/add.go b/add.go index 811d7bc2c..c80cef21c 100644 --- a/add.go +++ b/add.go @@ -4,9 +4,9 @@ import ( "context" "encoding/json" "errors" - "filepath" "io" "os" + "path/filepath" "github.com/ipfs/go-ipfs-files" )