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

View File

@@ -145,7 +145,7 @@ func (b *LocalBackend) handleC2NUpdate(w http.ResponseWriter, r *http.Request) {
res.Err = "invalid JSON from cmd/tailscale version --json"
return
}
if ver.Long != version.Long {
if ver.Long != version.Long() {
res.Err = "cmd/tailscale version mismatch"
return
}

View File

@@ -261,7 +261,7 @@ func (b *LocalBackend) getCertPEM(ctx context.Context, logf logger.Logf, traceAC
}
ac := &acme.Client{
Key: key,
UserAgent: "tailscaled/" + version.Long,
UserAgent: "tailscaled/" + version.Long(),
}
a, err := ac.GetReg(ctx, "" /* pre-RFC param */)

View File

@@ -592,7 +592,7 @@ func (b *LocalBackend) updateStatus(sb *ipnstate.StatusBuilder, extraLocked func
b.mu.Lock()
defer b.mu.Unlock()
sb.MutateStatus(func(s *ipnstate.Status) {
s.Version = version.Long
s.Version = version.Long()
s.TUN = !wgengine.IsNetstack(b.e)
s.BackendState = b.state.String()
s.AuthURL = b.authURLSticky
@@ -1853,7 +1853,7 @@ func (b *LocalBackend) WatchNotifications(ctx context.Context, mask ipn.NotifyWa
b.mu.Lock()
const initialBits = ipn.NotifyInitialState | ipn.NotifyInitialPrefs | ipn.NotifyInitialNetMap
if mask&initialBits != 0 {
ini = &ipn.Notify{Version: version.Long}
ini = &ipn.Notify{Version: version.Long()}
if mask&ipn.NotifyInitialState != 0 {
ini.State = ptr.To(b.state)
if b.state == ipn.NeedsLogin {
@@ -1952,7 +1952,7 @@ func (b *LocalBackend) send(n ipn.Notify) {
n.Prefs = ptr.To(stripKeysFromPrefs(*n.Prefs))
}
if n.Version == "" {
n.Version = version.Long
n.Version = version.Long()
}
b.mu.Lock()