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:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user