提交 380337b7 作者: Matt Bell

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

上级 015bd06c
......@@ -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
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论