From 4ff4a327ffdd62b3191f8a96518a07c15fe57a3d Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Mon, 27 Sep 2021 10:49:08 -0400 Subject: [PATCH] Correctly identify backup timestamp var as a string Follow-up to: https://github.com/vitessio/vitess/pull/8824 I noticed this oversight after it was merged. :-) Signed-off-by: Matt Lord --- go/vt/vtctl/backup.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/go/vt/vtctl/backup.go b/go/vt/vtctl/backup.go index 88514ed2bb8..8f8063fa3b3 100644 --- a/go/vt/vtctl/backup.go +++ b/go/vt/vtctl/backup.go @@ -241,7 +241,7 @@ func commandRemoveBackup(ctx context.Context, wr *wrangler.Wrangler, subFlags *f } func commandRestoreFromBackup(ctx context.Context, wr *wrangler.Wrangler, subFlags *flag.FlagSet, args []string) error { - backupTimestamp := subFlags.String("backup_timestamp", "", "Use the backup taken at or before this timestamp rather than using the latest backup.") + backupTimestampStr := subFlags.String("backup_timestamp", "", "Use the backup taken at or before this timestamp rather than using the latest backup.") if err := subFlags.Parse(args); err != nil { return err } @@ -253,11 +253,11 @@ func commandRestoreFromBackup(ctx context.Context, wr *wrangler.Wrangler, subFla backupTime := time.Time{} // Or if a backup timestamp was specified then we use the last backup taken at or before that time - if *backupTimestamp != "" { + if *backupTimestampStr != "" { var err error - backupTime, err = time.Parse(mysqlctl.BackupTimestampFormat, *backupTimestamp) + backupTime, err = time.Parse(mysqlctl.BackupTimestampFormat, *backupTimestampStr) if err != nil { - return vterrors.New(vtrpcpb.Code_INVALID_ARGUMENT, fmt.Sprintf("unable to parse the backup timestamp value provided of '%s'", *backupTimestamp)) + return vterrors.New(vtrpcpb.Code_INVALID_ARGUMENT, fmt.Sprintf("unable to parse the backup timestamp value provided of '%s'", *backupTimestampStr)) } }