INNER CODE UNIT · Go
printVersion
cweill/gotests · gotests/main.go:144
func printVersion() {
info, ok := debug.ReadBuildInfo()
if !ok {
fmt.Println("gotests (unknown version)")
return
}
version := info.Main.Version
if version == "" || version == "(devel)" {
version = "development"
}
fmt.Printf("gotests %s\n", version)
fmt.Printf("Go version: %s\n", info.GoVersion)
// Print VCS information if available
for _, setting := range info.Settings {
if setting.Key == "vcs.revision" {