mirror of
https://github.com/vbatts/go-mtree.git
synced 2024-12-26 15:36:30 +00:00
keywords: accurate nanoseconds for time=
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
parent
d1ddeb8e3d
commit
ef9ba54f10
1 changed files with 2 additions and 4 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue