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
+1
-3
@@ -8,8 +8,6 @@ import (
|
||||
"reflect"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"tailscale.com/types/ptr"
|
||||
)
|
||||
|
||||
// IsZeroable is the interface for things with an IsZero method.
|
||||
@@ -60,7 +58,7 @@ func CheckIsZero[T IsZeroable](t testing.TB, nonzeroValues map[reflect.Type]any)
|
||||
case timeType:
|
||||
return reflect.ValueOf(time.Unix(1704067200, 0))
|
||||
case timePtrType:
|
||||
return reflect.ValueOf(ptr.To(time.Unix(1704067200, 0)))
|
||||
return reflect.ValueOf(new(time.Unix(1704067200, 0)))
|
||||
}
|
||||
|
||||
switch ty.Kind() {
|
||||
|
||||
Reference in New Issue
Block a user