1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-05-20 08:27:29 +08:00

Remove fsrepo.At, make Open a constructor function

Nobody calls At without immediately calling Open.

First step, a mechanical transformation. Cleanups will follow.
This commit is contained in:
Tommi Virtanen
2015-03-13 16:01:14 -07:00
parent 215fed1051
commit fdd1cd8dc0
13 changed files with 87 additions and 102 deletions

View File

@ -66,8 +66,8 @@ in the bootstrap list).
return
}
r := fsrepo.At(req.Context().ConfigRoot)
if err := r.Open(); err != nil {
r, err := fsrepo.Open(req.Context().ConfigRoot)
if err != nil {
res.SetError(err, cmds.ErrNormal)
return
}
@ -143,8 +143,8 @@ var bootstrapRemoveCmd = &cmds.Command{
return
}
r := fsrepo.At(req.Context().ConfigRoot)
if err := r.Open(); err != nil {
r, err := fsrepo.Open(req.Context().ConfigRoot)
if err != nil {
res.SetError(err, cmds.ErrNormal)
return
}
@ -192,8 +192,8 @@ var bootstrapListCmd = &cmds.Command{
},
Run: func(req cmds.Request, res cmds.Response) {
r := fsrepo.At(req.Context().ConfigRoot)
if err := r.Open(); err != nil {
r, err := fsrepo.Open(req.Context().ConfigRoot)
if err != nil {
res.SetError(err, cmds.ErrNormal)
return
}