mirror of
https://github.com/tailscale/tailscale.git
synced 2025-10-08 23:49:56 +00:00
all: use any instead of interface{}
My favorite part of generics. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
This commit is contained in:

committed by
Josh Bleecher Snyder

parent
5f176f24db
commit
0868329936
@@ -66,16 +66,16 @@ func (p *Packet) short() string {
|
||||
return fmt.Sprintf("%s/%s", payload, tuple)
|
||||
}
|
||||
|
||||
func (p *Packet) Trace(msg string, args ...interface{}) {
|
||||
func (p *Packet) Trace(msg string, args ...any) {
|
||||
if !traceOn {
|
||||
return
|
||||
}
|
||||
allArgs := []interface{}{p.short(), p.locator, p.Src, p.Dst}
|
||||
allArgs := []any{p.short(), p.locator, p.Src, p.Dst}
|
||||
allArgs = append(allArgs, args...)
|
||||
fmt.Fprintf(os.Stderr, "[%s]%s src=%s dst=%s "+msg+"\n", allArgs...)
|
||||
}
|
||||
|
||||
func (p *Packet) setLocator(msg string, args ...interface{}) {
|
||||
func (p *Packet) setLocator(msg string, args ...any) {
|
||||
p.locator = fmt.Sprintf(" "+msg, args...)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user