From 5749eb24a4ae545d57fb20dd412aec8a11b76226 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..93f9e0c 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)