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
@@ -14,7 +14,6 @@ import (
"tailscale.com/types/opt"
"tailscale.com/types/persist"
"tailscale.com/types/preftype"
"tailscale.com/types/ptr"
)
// Clone makes a deep copy of LoginProfile.
@@ -62,7 +61,7 @@ func (src *Prefs) Clone() *Prefs {
}
}
if dst.RelayServerPort != nil {
dst.RelayServerPort = ptr.To(*src.RelayServerPort)
dst.RelayServerPort = new(*src.RelayServerPort)
}
dst.RelayServerStaticEndpoints = append(src.RelayServerStaticEndpoints[:0:0], src.RelayServerStaticEndpoints...)
dst.Persist = src.Persist.Clone()
@@ -122,7 +121,7 @@ func (src *ServeConfig) Clone() *ServeConfig {
if v == nil {
dst.TCP[k] = nil
} else {
dst.TCP[k] = ptr.To(*v)
dst.TCP[k] = new(*v)
}
}
}
@@ -184,7 +183,7 @@ func (src *ServiceConfig) Clone() *ServiceConfig {
if v == nil {
dst.TCP[k] = nil
} else {
dst.TCP[k] = ptr.To(*v)
dst.TCP[k] = new(*v)
}
}
}