1
0
mirror of https://github.com/rancher/types.git synced 2025-06-28 06:26:49 +00:00

Update vendor

This commit is contained in:
Darren Shepherd 2018-01-01 22:12:48 -07:00
parent 11cbba4199
commit f328403701
2 changed files with 5 additions and 2 deletions

View File

@ -3,5 +3,5 @@ github.com/rancher/types
k8s.io/kubernetes v1.8.3 transitive=true,staging=true
bitbucket.org/ww/goautoneg a547fc61f48d567d5b4ec6f8aee5573d8efce11d https://github.com/rancher/goautoneg.git
github.com/rancher/norman b80039523f49e7bfd335031ac82208f1bbf6bd40
github.com/rancher/norman c94e18869aa8779706235e42263aeadd754e7752
golang.org/x/sync fd80eb99c8f653c847d294a001bdf2a3a6f768f5

View File

@ -27,6 +27,9 @@ func Singular(value interface{}) interface{} {
}
func ToString(value interface{}) string {
if t, ok := value.(time.Time); ok {
return t.Format(time.RFC3339)
}
single := Singular(value)
if single == nil {
return ""
@ -37,7 +40,7 @@ func ToString(value interface{}) string {
func ToTimestamp(value interface{}) (int64, error) {
str := ToString(value)
if str == "" {
return 0, errors.New("Invalid date")
return 0, errors.New("invalid date")
}
t, err := time.Parse(time.RFC3339, str)
if err != nil {