From 98d20e99ea41a9771db3ba8b01c52a5b5fae278d Mon Sep 17 00:00:00 2001 From: chupei Date: Fri, 13 Jan 2023 15:18:08 +0800 Subject: [PATCH] feat: make GitCommitDate as optional --- .gitignore | 5 ++++- version.go | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index d0a55da..9e32a05 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,7 @@ *.so # example binary -examples/examples \ No newline at end of file +examples/examples + +# idea +.idea/ \ No newline at end of file diff --git a/version.go b/version.go index 6349b02..80c3b66 100644 --- a/version.go +++ b/version.go @@ -73,7 +73,10 @@ func Print() { xprintf("Go version", GoVersion) xprintf("Git commit", GitCommit) - xprintf("Commit date", GitCommitDate) + + if GitCommitDate != unknownProperty{ + xprintf("Commit date", GitCommitDate) + } if GitTreeState != unknownProperty { xprintf("Git state", GitTreeState)