From 4fa6cbec2710c3d73e3507b0275e03918c229b65 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Fri, 3 May 2024 06:22:29 -0700 Subject: [PATCH] ssh/tailssh: use ptr.To in test Updates #cleanup Change-Id: Ic98ba1b63c8205084b30f59f0ca343788edea5b0 Signed-off-by: Brad Fitzpatrick --- ssh/tailssh/tailssh_test.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ssh/tailssh/tailssh_test.go b/ssh/tailssh/tailssh_test.go index 06a87f6a6..b3f9bc43c 100644 --- a/ssh/tailssh/tailssh_test.go +++ b/ssh/tailssh/tailssh_test.go @@ -44,6 +44,7 @@ import ( "tailscale.com/types/logger" "tailscale.com/types/logid" "tailscale.com/types/netmap" + "tailscale.com/types/ptr" "tailscale.com/util/cibuild" "tailscale.com/util/lineread" "tailscale.com/util/must" @@ -87,7 +88,7 @@ func TestMatchRule(t *testing.T) { name: "expired", rule: &tailcfg.SSHRule{ Action: someAction, - RuleExpires: timePtr(time.Unix(100, 0)), + RuleExpires: ptr.To(time.Unix(100, 0)), }, ci: &sshConnInfo{}, wantErr: errRuleExpired, @@ -222,8 +223,6 @@ func TestMatchRule(t *testing.T) { } } -func timePtr(t time.Time) *time.Time { return &t } - // localState implements ipnLocalBackend for testing. type localState struct { sshEnabled bool