Skip to content

Commit b573768

Browse files
committed
Move files.go out of its own directory.
It is a single file so putting it in its own package is a bit of an overkill. License: MIT Signed-off-by: Kevin Atkinson <[email protected]>
1 parent 7538f25 commit b573768

File tree

3 files changed

+4
-48
lines changed

3 files changed

+4
-48
lines changed

core/commands/files/files.go renamed to core/commands/files.go

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import (
3131
ipld "gx/ipfs/Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES/go-ipld-format"
3232
)
3333

34-
var log = logging.Logger("cmds/files")
34+
var flog = logging.Logger("cmds/files")
3535

3636
var FilesCmd = &cmds.Command{
3737
Helptext: cmdkit.HelpText{
@@ -768,7 +768,7 @@ stat' on the file or any of its ancestors.
768768

769769
_, err = wfd.Seek(int64(offset), io.SeekStart)
770770
if err != nil {
771-
log.Error("seekfail: ", err)
771+
flog.Error("seekfail: ", err)
772772
res.SetError(err, cmdkit.ErrNormal)
773773
return
774774
}
@@ -1112,7 +1112,7 @@ func getFileHandle(r *mfs.Root, path string, create bool, prefix *cid.Prefix) (*
11121112
dirname, fname := gopath.Split(path)
11131113
pdiri, err := mfs.Lookup(r, dirname)
11141114
if err != nil {
1115-
log.Error("lookupfail ", dirname)
1115+
flog.Error("lookupfail ", dirname)
11161116
return nil, err
11171117
}
11181118
pdir, ok := pdiri.(*mfs.Directory)
@@ -1161,17 +1161,3 @@ func checkPath(p string) (string, error) {
11611161
}
11621162
return cleaned, nil
11631163
}
1164-
1165-
// copy+pasted from ../commands.go
1166-
func unwrapOutput(i interface{}) (interface{}, error) {
1167-
var (
1168-
ch <-chan interface{}
1169-
ok bool
1170-
)
1171-
1172-
if ch, ok = i.(<-chan interface{}); !ok {
1173-
return nil, e.TypeErr(ch, i)
1174-
}
1175-
1176-
return <-ch, nil
1177-
}

core/commands/files/env.go

Lines changed: 0 additions & 29 deletions
This file was deleted.

core/commands/root.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
oldcmds "github.com/ipfs/go-ipfs/commands"
88
dag "github.com/ipfs/go-ipfs/core/commands/dag"
99
e "github.com/ipfs/go-ipfs/core/commands/e"
10-
files "github.com/ipfs/go-ipfs/core/commands/files"
1110
ocmd "github.com/ipfs/go-ipfs/core/commands/object"
1211
unixfs "github.com/ipfs/go-ipfs/core/commands/unixfs"
1312

@@ -109,7 +108,7 @@ var rootSubcommands = map[string]*cmds.Command{
109108
"block": BlockCmd,
110109
"cat": CatCmd,
111110
"commands": CommandsDaemonCmd,
112-
"files": files.FilesCmd,
111+
"files": FilesCmd,
113112
"filestore": FileStoreCmd,
114113
"get": GetCmd,
115114
"pubsub": PubsubCmd,

0 commit comments

Comments
 (0)