diff --git a/version/version.go b/version/version.go index 3b00d12d9c..9e018713de 100644 --- a/version/version.go +++ b/version/version.go @@ -26,11 +26,12 @@ func PrintVersion(c *cli.Context) { outdated, err := AIsNewerThanB(upstreamVersion, Version) if err != nil { out += fmt.Sprintf("\n[warning] failed to compare current version with latest: %v\n", err) - } - if outdated { - out += fmt.Sprintf("\n[info] sops %s is available, update with `go get -u go.mozilla.org/sops/v3/cmd/sops`\n", upstreamVersion) } else { - out += " (latest)\n" + if outdated { + out += fmt.Sprintf("\n[info] sops %s is available, update with `go get -u go.mozilla.org/sops/v3/cmd/sops`\n", upstreamVersion) + } else { + out += " (latest)\n" + } } } fmt.Fprintf(c.App.Writer, "%s", out)