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
@@ -9,14 +9,13 @@ import (
|
||||
"runtime"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
"tailscale.com/types/ptr"
|
||||
)
|
||||
|
||||
func init() {
|
||||
unameMachine = lazyUnameMachine.Get
|
||||
}
|
||||
|
||||
var lazyUnameMachine = &lazyAtomicValue[string]{f: ptr.To(unameMachineUnix)}
|
||||
var lazyUnameMachine = &lazyAtomicValue[string]{f: new(unameMachineUnix)}
|
||||
|
||||
func unameMachineUnix() string {
|
||||
switch runtime.GOOS {
|
||||
|
||||
Reference in New Issue
Block a user