aports/community/tailscale/cli-status-fix-non-constant-formatstring.patch

36 lines
1.1 KiB
Diff

Fixes: non-constant format string in call to f.
Since go 1.24, go vet warns about it. Apparently, go 1.26 also detects this for
custm functions that provide arguments to *printf functions.
diff --git a/cmd/tailscale/cli/status.go b/cmd/tailscale/cli/status.go
index 89b1833..f49ce82 100644
--- a/cmd/tailscale/cli/status.go
+++ b/cmd/tailscale/cli/status.go
@@ -175,13 +175,13 @@ func runStatus(ctx context.Context, args []string) error {
}
if !ps.Active {
if ps.ExitNode {
- f("idle; exit node" + offline)
+ f("idle; exit node%s", offline)
} else if ps.ExitNodeOption {
- f("idle; offers exit node" + offline)
+ f("idle; offers exit node%s", offline)
} else if anyTraffic {
- f("idle" + offline)
+ f("idle%s", offline)
} else if !ps.Online {
- f("offline" + lastSeenFmt(ps.LastSeen))
+ f("offline%s", lastSeenFmt(ps.LastSeen))
} else {
f("-")
}
@@ -200,7 +200,7 @@ func runStatus(ctx context.Context, args []string) error {
f("peer-relay %s", ps.PeerRelay)
}
if !ps.Online {
- f(offline)
+ f("%s", offline)
}
}
if anyTraffic {