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:
committed by
Brad Fitzpatrick
parent
8cfbaa717d
commit
2a64c03c95
@@ -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
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user