The Great Rewrite (fixes #36, #61, #94, #101)

Rewrite of the file model and pulling mechanism. Needs lots of cleanup
and bugfixes, now...
This commit is contained in:
Jakob Borg
2014-03-28 14:36:57 +01:00
parent 3700eb1e61
commit f87b1520e8
47 changed files with 2137 additions and 1902 deletions

View File

@@ -1,6 +1,10 @@
package main
import "fmt"
import (
"fmt"
"os"
"runtime"
)
func MetricPrefix(n int64) string {
if n > 1e9 {
@@ -27,3 +31,13 @@ func BinaryPrefix(n int64) string {
}
return fmt.Sprintf("%d ", n)
}
func Rename(from, to string) error {
if runtime.GOOS == "windows" {
err := os.Remove(to)
if err != nil && !os.IsNotExist(err) {
warnln(err)
}
}
return os.Rename(from, to)
}