From 3bf46ab1fcd773fc780873fa8dc6a9cdc0d7a937 Mon Sep 17 00:00:00 2001 From: i582 Date: Tue, 29 Jun 2021 22:07:21 +0300 Subject: [PATCH] cmd: improved date output and removed the logging of current date from the beginning of the output for the version command --- Makefile | 2 +- cmd/main.go | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 78e0a5f..07d0965 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -NOW=`date +%Y%m%d%H%M%S` +NOW=`date '+%Y.%m.%d %H:%M:%S'` OS=`uname -n -m` AFTER_COMMIT=`git rev-parse HEAD` GOPATH_DIR=`go env GOPATH` diff --git a/cmd/main.go b/cmd/main.go index af642a5..f4588f7 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -2,6 +2,7 @@ package cmd import ( "flag" + "fmt" "log" "os" "path/filepath" @@ -23,10 +24,11 @@ var ( ) func printVersion(mainConfig *cmd.MainConfig) { + fmt.Print("NoColor, ") if BuildCommit == "" { - log.Printf("Version %s: built without version info", mainConfig.LinterVersion) + fmt.Printf("version %s: built without version info", mainConfig.LinterVersion) } else { - log.Printf("Version %s: built on: %s OS: %s Commit: %s\n", mainConfig.LinterVersion, BuildTime, BuildOSUname, BuildCommit) + fmt.Printf("version %s: built on: %s OS: %s Commit: %s\n", mainConfig.LinterVersion, BuildTime, BuildOSUname, BuildCommit) } }