Remove github.com/satori/go.uuid.
This commit is contained in:
parent
e1d097ea20
commit
2e19e45aa4
25 changed files with 1027 additions and 365 deletions
23
vendor/github.com/Masterminds/sprig/date.go
generated
vendored
23
vendor/github.com/Masterminds/sprig/date.go
generated
vendored
|
@ -51,3 +51,26 @@ func dateModify(fmt string, date time.Time) time.Time {
|
|||
}
|
||||
return date.Add(d)
|
||||
}
|
||||
|
||||
func dateAgo(date interface{}) string {
|
||||
var t time.Time
|
||||
|
||||
switch date := date.(type) {
|
||||
default:
|
||||
t = time.Now()
|
||||
case time.Time:
|
||||
t = date
|
||||
case int64:
|
||||
t = time.Unix(date, 0)
|
||||
case int:
|
||||
t = time.Unix(int64(date), 0)
|
||||
}
|
||||
// Drop resolution to seconds
|
||||
duration := time.Since(t).Round(time.Second)
|
||||
return duration.String()
|
||||
}
|
||||
|
||||
func toDate(fmt, str string) time.Time {
|
||||
t, _ := time.ParseInLocation(fmt, str, time.Local)
|
||||
return t
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue