fix?
This commit is contained in:
parent
db32d69d65
commit
fc2e385efc
1 changed files with 4 additions and 4 deletions
|
@ -360,14 +360,14 @@ type AMTEntry struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Valid reports if the entry is valid.
|
// Valid reports if the entry is valid.
|
||||||
func (e *AMTEntry) Valid() bool {
|
func (e AMTEntry) Valid() bool {
|
||||||
return e != nil && time.Since(e.LastUpdated) < maxAMTEntryAge
|
return time.Since(e.LastUpdated) < maxAMTEntryAge
|
||||||
}
|
}
|
||||||
|
|
||||||
// LastUpdatedAgo is a friendly string reporting how long ago the entry was
|
// LastUpdatedAgo is a friendly string reporting how long ago the entry was
|
||||||
// updated/resolved.
|
// updated/resolved.
|
||||||
func (e *AMTEntry) LastUpdatedAgo() string {
|
func (e AMTEntry) LastUpdatedAgo() string {
|
||||||
if e == nil || e.LastUpdated.IsZero() {
|
if e.LastUpdated.IsZero() {
|
||||||
return "never"
|
return "never"
|
||||||
}
|
}
|
||||||
return fmt.Sprintf("%v ago", time.Since(e.LastUpdated).Truncate(time.Millisecond))
|
return fmt.Sprintf("%v ago", time.Since(e.LastUpdated).Truncate(time.Millisecond))
|
||||||
|
|
Loading…
Reference in a new issue