tailcfg: format integer IDs as decimal consistently

The server-side code already does e.g. "nodeid:%d" instead of "%x"
and as a result we have to second guess a lot of identifiers that could
be hex or decimal.

This stops the bleeding and means in a year and change we'll stop
seeing the hex forms.

Updates tailscale/corp#29827

Change-Id: Ie5785a07fc32631f7c949348d3453538ab170e6d
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick 2025-06-23 09:02:03 -07:00 committed by Brad Fitzpatrick
parent 3dc694b4f1
commit ee8c3560ef

View File

@ -2265,10 +2265,10 @@ type Debug struct {
Exit *int `json:",omitempty"`
}
func (id ID) String() string { return fmt.Sprintf("id:%x", int64(id)) }
func (id UserID) String() string { return fmt.Sprintf("userid:%x", int64(id)) }
func (id LoginID) String() string { return fmt.Sprintf("loginid:%x", int64(id)) }
func (id NodeID) String() string { return fmt.Sprintf("nodeid:%x", int64(id)) }
func (id ID) String() string { return fmt.Sprintf("id:%d", int64(id)) }
func (id UserID) String() string { return fmt.Sprintf("userid:%d", int64(id)) }
func (id LoginID) String() string { return fmt.Sprintf("loginid:%d", int64(id)) }
func (id NodeID) String() string { return fmt.Sprintf("nodeid:%d", int64(id)) }
// Equal reports whether n and n2 are equal.
func (n *Node) Equal(n2 *Node) bool {