From 30f5600b472bf572117cb7ba67647eb811e70ffe Mon Sep 17 00:00:00 2001 From: Alvin Huang <17609145+alvin-huang@users.noreply.github.com> Date: Mon, 20 Jul 2020 17:43:10 -0400 Subject: [PATCH] add v to version pretty formatter (#8341) * add v to version pretty formatter * remove v from json version output --- command/version/formatter.go | 2 +- command/version/testdata/pretty.golden | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/command/version/formatter.go b/command/version/formatter.go index b6d995ae25..1cfcf5dfd6 100644 --- a/command/version/formatter.go +++ b/command/version/formatter.go @@ -38,7 +38,7 @@ func newPrettyFormatter() Formatter { func (_ *prettyFormatter) Format(info *VersionInfo) (string, error) { var buffer bytes.Buffer - buffer.WriteString(fmt.Sprintf("Consul %s\n", info.HumanVersion)) + buffer.WriteString(fmt.Sprintf("Consul v%s\n", info.HumanVersion)) if info.Revision != "" { buffer.WriteString(fmt.Sprintf("Revision %s\n", info.Revision)) } diff --git a/command/version/testdata/pretty.golden b/command/version/testdata/pretty.golden index 09d5118326..36cb2482c2 100644 --- a/command/version/testdata/pretty.golden +++ b/command/version/testdata/pretty.golden @@ -1,3 +1,3 @@ -Consul 1.99.3-beta1 +Consul v1.99.3-beta1 Revision 5e5dbedd47a5f875b60e241c5555a9caab595246 Protocol 2 spoken by default, understands 1 to 3 (agent will automatically use protocol >2 when speaking to compatible agents)