1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-08-06 19:44:01 +08:00

commands/cli: Use filepath.Join for file path building

This commit is contained in:
Matt Bell
2014-11-17 02:38:20 -08:00
parent 015bd06cff
commit 380337b76b

View File

@ -5,6 +5,7 @@ import (
"errors"
"fmt"
"os"
fp "path/filepath"
"strings"
cmds "github.com/jbenet/go-ipfs/commands"
@ -281,7 +282,7 @@ func getFile(file *os.File, path string) (cmds.File, error) {
files := make([]cmds.File, 0, len(contents))
for _, child := range contents {
childPath := fmt.Sprintf("%s/%s", path, child.Name())
childPath := fp.Join(path, child.Name())
childFile, err := os.Open(childPath)
if err != nil {
return nil, err