types/ptr: deprecate ptr.To, use Go 1.26 new

Updates #18682

Change-Id: I62f6aa0de2a15ef8c1435032c6aa74a181c25f8f
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2026-03-05 22:48:46 +00:00
committed by Brad Fitzpatrick
parent 8cfbaa717d
commit 2a64c03c95
96 changed files with 429 additions and 532 deletions
+3 -4
View File
@@ -16,7 +16,6 @@ import (
"tailscale.com/ipn"
"tailscale.com/ipn/lapitest"
"tailscale.com/tsd"
"tailscale.com/types/ptr"
"tailscale.com/util/syspolicy/pkey"
"tailscale.com/util/syspolicy/policytest"
)
@@ -49,7 +48,7 @@ func TestUserConnectDisconnectNonWindows(t *testing.T) {
// And if we send a notification, both users should receive it.
wantErrMessage := "test error"
testNotify := ipn.Notify{ErrMessage: ptr.To(wantErrMessage)}
testNotify := ipn.Notify{ErrMessage: new(wantErrMessage)}
server.Backend().DebugNotify(testNotify)
if n, err := watcherA.Next(); err != nil {
@@ -274,12 +273,12 @@ func TestShutdownViaLocalAPI(t *testing.T) {
},
{
name: "AllowTailscaledRestart/False",
allowTailscaledRestart: ptr.To(false),
allowTailscaledRestart: new(false),
wantErr: errAccessDeniedByPolicy,
},
{
name: "AllowTailscaledRestart/True",
allowTailscaledRestart: ptr.To(true),
allowTailscaledRestart: new(true),
wantErr: nil, // shutdown should be allowed
},
}