Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

Commit

Permalink
cmd: improved date output and removed the logging of current date fro…
Browse files Browse the repository at this point in the history
…m the beginning of the output for the version command
  • Loading branch information
i582 committed Jun 29, 2021
1 parent 7efa67e commit 3bf46ab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion 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`
Expand Down
6 changes: 4 additions & 2 deletions cmd/main.go
Expand Up @@ -2,6 +2,7 @@ package cmd

import (
"flag"
"fmt"
"log"
"os"
"path/filepath"
Expand All @@ -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)
}
}

Expand Down

0 comments on commit 3bf46ab

Please sign in to comment.