1
0
Fork 0
mirror of https://github.com/vbatts/go-mtree.git synced 2024-11-05 00:15:58 +00:00

keywords: accurate nanoseconds for time=

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
Vincent Batts 2016-03-18 09:42:16 -04:00
parent d1ddeb8e3d
commit ef9ba54f10

View file

@ -8,7 +8,6 @@ import (
"fmt"
"hash"
"io"
"math"
"os"
"golang.org/x/crypto/ripemd160"
@ -113,9 +112,8 @@ var (
}
}
timeKeywordFunc = func(path string, info os.FileInfo) (string, error) {
t := info.ModTime()
n := float64(t.UnixNano()) / math.Pow10(9)
return fmt.Sprintf("time=%0.9f", n), nil
t := info.ModTime().UnixNano()
return fmt.Sprintf("time=%d.%d", (t / 1e9), (t % (t / 1e9))), nil
}
linkKeywordFunc = func(path string, info os.FileInfo) (string, error) {
if info.Mode()&os.ModeSymlink != 0 {