Include go version into builds

This commit is contained in:
Dan Sosedoff
2019-11-29 13:59:50 -06:00
parent a21ff40588
commit 8b1f234b91
3 changed files with 17 additions and 7 deletions

View File

@@ -143,12 +143,14 @@ func initOptions() {
}
func printVersion() {
str := fmt.Sprintf("Pgweb v%s", command.Version)
chunks := []string{fmt.Sprintf("Pgweb v%s", command.Version)}
if command.GitCommit != "" {
str += fmt.Sprintf(" (git: %s)", command.GitCommit)
chunks = append(chunks, fmt.Sprintf("(git: %s)", command.GitCommit))
}
fmt.Println(str)
if command.GoVersion != "" {
chunks = append(chunks, fmt.Sprintf("(go: %s)", command.GoVersion))
}
fmt.Println(strings.Join(chunks, " "))
}
func startServer() {