commands/cli: Use filepath.Join for file path building
Matt Bell committed
Nov 17, 2014 at 02:38 UTC
380337b76b24751af4b512646939760717a8322c
1 file changed
+2
-1
commands/cli/parse.go
+2
-1
@@ -5,6 +5,7 @@ import (
5
"errors"
6
"fmt"
7
"os"
8
+ fp "path/filepath"
9
"strings"
10
11
cmds "github.com/jbenet/go-ipfs/commands"
@@ -281,7 +282,7 @@ func getFile(file *os.File, path string) (cmds.File, error) {
282
files := make([]cmds.File, 0, len(contents))
283
284
for _, child := range contents {
284
- childPath := fmt.Sprintf("%s/%s", path, child.Name())
285
+ childPath := fp.Join(path, child.Name())
286
childFile, err := os.Open(childPath)
287
if err != nil {
288
return nil, err