From 1732243672e8ee811aab28afde1a268b492252f7 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Wed, 29 Apr 2015 01:43:23 -0700 Subject: [PATCH] Fix the bug re-introduced from previous fixes --- cmd-update.go | 2 +- main.go | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cmd-update.go b/cmd-update.go index ff6e71fd..edfa5417 100644 --- a/cmd-update.go +++ b/cmd-update.go @@ -84,7 +84,7 @@ func runUpdateCmd(ctx *cli.Context) { log.Debug.Println(iodine.New(err, nil)) console.Fatalln("Unable to parse update time:", results.LatestBuild) } - current := getBuildDate() + current, _ := time.Parse(time.RFC3339Nano, BuildDate) if current.IsZero() { console.Fatalln("BuildDate is zero, must be a wrong build exiting..") } diff --git a/main.go b/main.go index 73bd5a24..9c562ba6 100644 --- a/main.go +++ b/main.go @@ -57,12 +57,12 @@ func checkConfig() { var BuildDate string // getBuildDate - -func getBuildDate() time.Time { - if BuildDate == "" { - return time.Time{} - } +func getBuildDate() string { t, _ := time.Parse(time.RFC3339Nano, BuildDate) - return t + if t.IsZero() { + return "" + } + return t.Format(time.RFC1123) } // Get os/arch/platform specific information. @@ -99,7 +99,7 @@ func main() { app.Usage = "Minio Client for object storage and filesystems" app.Version = Version app.Commands = commands - app.Compiled = getBuildDate().Format(time.RFC1123) + app.Compiled = getBuildDate() app.Flags = flags app.Author = "Minio.io" app.Before = func(ctx *cli.Context) error {