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,7 +9,6 @@ import (
|
||||
|
||||
"github.com/google/go-cmp/cmp"
|
||||
"github.com/google/go-cmp/cmp/cmpopts"
|
||||
"tailscale.com/types/ptr"
|
||||
)
|
||||
|
||||
func TestGeneveHeader(t *testing.T) {
|
||||
@@ -47,22 +46,22 @@ func TestVirtualNetworkID(t *testing.T) {
|
||||
},
|
||||
{
|
||||
"Set 0",
|
||||
ptr.To(uint32(0)),
|
||||
new(uint32(0)),
|
||||
0,
|
||||
},
|
||||
{
|
||||
"Set 1",
|
||||
ptr.To(uint32(1)),
|
||||
new(uint32(1)),
|
||||
1,
|
||||
},
|
||||
{
|
||||
"Set math.MaxUint32",
|
||||
ptr.To(uint32(math.MaxUint32)),
|
||||
new(uint32(math.MaxUint32)),
|
||||
1<<24 - 1,
|
||||
},
|
||||
{
|
||||
"Set max 3-byte value",
|
||||
ptr.To(uint32(1<<24 - 1)),
|
||||
new(uint32(1<<24 - 1)),
|
||||
1<<24 - 1,
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user