version: unexport all vars, turn Short/Long into funcs

The other formerly exported values aren't used outside the package,
so just unexport them.

Signed-off-by: David Anderson <danderson@tailscale.com>
This commit is contained in:
David Anderson
2023-02-10 22:20:36 -08:00
committed by Dave Anderson
parent 9e6b4d7ad8
commit 8b2ae47c31
20 changed files with 67 additions and 59 deletions
+6 -6
View File
@@ -11,20 +11,20 @@ import (
func String() string {
var ret strings.Builder
ret.WriteString(Short)
ret.WriteString(short)
ret.WriteByte('\n')
if IsUnstableBuild() {
fmt.Fprintf(&ret, " track: unstable (dev); frequent updates and bugs are likely\n")
}
if GitCommit != "" {
if gitCommit != "" {
var dirty string
if GitDirty {
if gitDirty {
dirty = "-dirty"
}
fmt.Fprintf(&ret, " tailscale commit: %s%s\n", GitCommit, dirty)
fmt.Fprintf(&ret, " tailscale commit: %s%s\n", gitCommit, dirty)
}
if ExtraGitCommit != "" {
fmt.Fprintf(&ret, " other commit: %s\n", ExtraGitCommit)
if extraGitCommit != "" {
fmt.Fprintf(&ret, " other commit: %s\n", extraGitCommit)
}
fmt.Fprintf(&ret, " go version: %s\n", runtime.Version())
return strings.TrimSpace(ret.String())