From 6d67b2dc59f2ce8ba239c9ac01f2f5e2377c45fc Mon Sep 17 00:00:00 2001 From: miyado <10195648+hmiyado@users.noreply.github.com> Date: Mon, 18 Jul 2022 16:33:53 +0900 Subject: [PATCH] Fix for TimestampFlag.GetValue to return empty string without value --- flag_timestamp.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flag_timestamp.go b/flag_timestamp.go index 80e1f470be..16f42dd011 100644 --- a/flag_timestamp.go +++ b/flag_timestamp.go @@ -90,7 +90,7 @@ func (f *TimestampFlag) GetCategory() string { // GetValue returns the flags value as string representation and an empty // string if the flag takes no value at all. func (f *TimestampFlag) GetValue() string { - if f.Value != nil { + if f.Value != nil && f.Value.timestamp != nil { return f.Value.timestamp.String() } return ""