reverting export of fixTime

This commit is contained in:
davemay99 2020-09-29 01:21:03 -04:00
parent 61c12e3e18
commit bb555b249f
3 changed files with 6 additions and 6 deletions

View File

@ -10,8 +10,8 @@ import (
"github.com/hashicorp/nomad/nomad/structs"
)
// FixTime converts any suspected time.Time binary string representation to time.Time
func FixTime(v interface{}) {
// fixTime converts any suspected time.Time binary string representation to time.Time
func fixTime(v interface{}) {
switch v2 := v.(type) {
case map[string]interface{}:
for ek, ev := range v2 {
@ -21,12 +21,12 @@ func FixTime(v interface{}) {
v2[ek] = *t
}
} else {
FixTime(ev)
fixTime(ev)
}
}
case []interface{}:
for _, e := range v2 {
FixTime(e)
fixTime(e)
}
default:
return

View File

@ -49,7 +49,7 @@ func TestDecodesTime(t *testing.T) {
require.Equal(t, "host", r["Mode"])
require.IsType(t, "", r["CreateTime"])
FixTime(r)
fixTime(r)
expected := map[string]interface{}{
"CreateTime": now,

View File

@ -117,7 +117,7 @@ func decode(e *raft.Log) (*logMessage, error) {
fmt.Fprintf(os.Stderr, "failed to decode log entry at index %d: failed to decode body of %v.%v %v\n", e.Index, e.Type, m.CommandType, err)
v = "FAILED TO DECODE DATA"
}
FixTime(v)
fixTime(v)
m.Body = v
}