Skip to content

Commit

Permalink
Report server version on startup.
Browse files Browse the repository at this point in the history
  • Loading branch information
riannucci committed Oct 21, 2021
1 parent 2b209bb commit 0dd93eb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions goconvey.go
Expand Up @@ -15,6 +15,7 @@ import (
"path/filepath"
"regexp"
"runtime"
"runtime/debug"
"strconv"
"strings"
"time"
Expand Down Expand Up @@ -58,7 +59,12 @@ func folders() {

func main() {
flag.Parse()
log.Printf(initialConfiguration, host, port, nap, cover)

serverVersion := "<unknown>"
if binfo, ok := debug.ReadBuildInfo(); ok {
serverVersion = binfo.Main.Version
}
log.Printf(initialConfiguration, host, port, nap, cover, serverVersion)

working := getWorkDir()
cover = coverageEnabled(cover, reports)
Expand Down Expand Up @@ -309,7 +315,7 @@ var (
)

const (
initialConfiguration = "Initial configuration: [host: %s] [port: %d] [poll: %v] [cover: %v]\n"
initialConfiguration = "Initial configuration: [host: %s] [port: %d] [poll: %v] [cover: %v] [server version: %s]\n"
pleaseUpgradeGoVersion = "Go version is less that 1.2 (%s), please upgrade to the latest stable version to enable coverage reporting.\n"
coverToolMissing = "Go cover tool is not installed or not accessible: for Go < 1.5 run`go get golang.org/x/tools/cmd/cover`\n For >= Go 1.5 run `go install $GOROOT/src/cmd/cover`\n"
reportDirectoryUnavailable = "Could not find or create the coverage report directory (at: '%s'). You probably won't see any coverage statistics...\n"
Expand Down

0 comments on commit 0dd93eb

Please sign in to comment.