Skip to content

Commit ebb0eca

Browse files
committed
Change go-os-rename to standard
Since Go 1.5, os.Rename is consistent across platforms
1 parent 542131a commit ebb0eca

File tree

3 files changed

+4
-12
lines changed

3 files changed

+4
-12
lines changed

convert.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import (
1313

1414
"github.com/ipfs/go-datastore"
1515
"github.com/ipfs/go-datastore/query"
16-
"github.com/jbenet/go-os-rename"
1716
)
1817

1918
func UpgradeV0toV1(path string, prefixLen int) error {
@@ -152,7 +151,7 @@ func Move(oldPath string, newPath string, out io.Writer) error {
152151
// else we found something unexpected, so to be safe just move it
153152
log.Warningf("found unexpected file in datastore directory: \"%s\", moving anyway\n", fn)
154153
newPath := filepath.Join(newDS.path, fn)
155-
err := osrename.Rename(oldPath, newPath)
154+
err := os.Rename(oldPath, newPath)
156155
if err != nil {
157156
return err
158157
}
@@ -173,7 +172,7 @@ func moveKey(oldDS *Datastore, newDS *Datastore, key datastore.Key) error {
173172
if err != nil {
174173
return err
175174
}
176-
err = osrename.Rename(oldPath, newPath)
175+
err = os.Rename(oldPath, newPath)
177176
if err != nil {
178177
return err
179178
}

flatfs.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import (
1919

2020
"github.com/ipfs/go-datastore"
2121
"github.com/ipfs/go-datastore/query"
22-
"github.com/jbenet/go-os-rename"
2322

2423
logging "github.com/ipfs/go-log"
2524
)
@@ -286,7 +285,7 @@ func (fs *Datastore) renameAndUpdateDiskUsage(tmpPath, path string) error {
286285
// Rename and add new file's diskUsage. If the rename fails,
287286
// it will either a) Re-add the size of an existing file, which
288287
// was sustracted before b) Add 0 if there is no existing file.
289-
err = osrename.Rename(tmpPath, path)
288+
err = os.Rename(tmpPath, path)
290289
fs.updateDiskUsage(path, true)
291290
return err
292291
}
@@ -779,7 +778,7 @@ func (fs *Datastore) persistDiskUsageFile() {
779778
return
780779
}
781780

782-
osrename.Rename(tmp.Name(), filepath.Join(fs.path, DiskUsageFile))
781+
os.Rename(tmp.Name(), filepath.Join(fs.path, DiskUsageFile))
783782
}
784783

785784
func (fs *Datastore) readDiskUsageFile() int64 {

package.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@
1212
"name": "go-log",
1313
"version": "1.4.0"
1414
},
15-
{
16-
"author": "jbenet",
17-
"hash": "QmaeRR9SpXumU5tYLRkq6x6pfMe8qKzxn4ujBpsTJ2zQG7",
18-
"name": "go-os-rename",
19-
"version": "0.0.0"
20-
},
2115
{
2216
"author": "jbenet",
2317
"hash": "QmeiCcJfDW1GJnWUArudsv5rQsihpi4oyddPhdqo3CfX6i",

0 commit comments

Comments
 (0)